表单的动态ChoiceField
摘要:
创建并初始化动态ChoiceFiled的方法:class ViewListForm(forms.Form): UIViewId = forms.ChoiceField() def __init__(self,UIViewList,*args, **kwargs): super(ViewListForm, self).__init__(*args, **kwargs) self.fields['UIViewId'] = forms.ChoiceField(choices=[(UIView["Id"], UIView["Name"]) for 阅读全文
posted @ 2013-04-07 19:01 0x9801 阅读(219) 评论(0) 推荐(0)
浙公网安备 33010602011771号