class Test forms Form name forms ChoiceField choices value1 value2 dat

1
2
3
4
5
6
7
class Test(forms.Form)
name = forms.ChoiceField(choices={'a':'value1','b':'value2'})
data = {'name':'a'}
a = Test(data)
a.is_valid()