I want to set different id for each radio choice.
My Model:-
class Preference(models.Model):
BOARD_CHOICES = [('CB', 'CBSE'), ('IC', 'ICSE'), ('SB', 'State Board'),
('IB', 'International Board')]
Board = models.CharField(max_length=30, choices=BOARD_CHOICES, default='CBSE', blank=False)
My Form:-
class PreferenceForm(forms.ModelForm):
class Meta:
model = Preference
fields = ['Board']
widgets = {
'Board': forms.RadioSelect(),
}
i.e for the radio button with label 'CBSE' I want to set id to say 'choice_1' and so on.
All help/suggestion would be appreciated.