下面是表单中的字段声明:
max_number = forms.ChoiceField(widget = forms.Select(),
choices = ([('1','1'), ('2','2'),('3','3'), ]), initial='3', required = True,)
I would like to set the initial value to be 3
and this doesn't seem to work. I have played about with the param, quotes/no quotes, etc... but no change.
如果可能的话,有人能给我一个明确的答案吗? 或者在我的代码片段中进行必要的调整?
我正在使用姜戈1.0