我有一个表格:
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
对于我写的这门课,选择中没有任何选项。如何BASE_FIELDS
在base_field
字段中插入。
提前致谢