Look at setting the field’s widget and choices when writing the form class.
from django import forms
class PictureForm(forms.Form):
CHOICES = [
('1', 'Option 1'),
('2', 'Option 2'),
]
like = forms.ChoiceField(
widget=forms.RadioSelect,
choices=CHOICES,
)
- The default
widgetof ChoiceField is a drop down select. - The
choicesargument has the same format as the one of a model field.