I have a form:
class MatchForm(forms.Form):
base_field = forms.CharField(widget=forms.Select)
def __init__(self ,*args, **kwargs):
BASE_FIELDS = (
('job','JOB'),
('car','CAR'),
)
super(MatchForm,self).__init__(*args, **kwargs)
self.fields['base_field'].choices = BASE_FIELDS
with this class that I have written, there is no any option in select. How can I insert BASE_FIELDS
in base_field field.
Thanks in advance
1 Answer