我的表单中有一个字段
myFormList = [(u'Select',u'Select')]
myForm = forms.ChoiceField(choices=myFormList)
我正在使用动态初始化它
form.fields['myForm'].choices = form.fields['myForm'].choices + anotherMyFormList
这会导致验证错误Select a valid choice. ** is not one of the available
choices
通常我摆脱这个错误
myForm = forms.CharField(widget = forms.Select(choices=myFormList))
但是由于我必须form.fields['myForm'].choices
在动态初始化时使用我不能使用小部件。我该怎么做form.fields['myForm'].widgets.choices =