class MyModelForm(forms.ModelForm): boolfield = forms.TypedChoiceField( coerce=lambda x: x == 'True', choices=((False, 'False'), (True, 'True')), widget=forms.RadioSelect ) class meta: model = MyModel
欢迎分享,转载请注明来源:内存溢出
class MyModelForm(forms.ModelForm): boolfield = forms.TypedChoiceField( coerce=lambda x: x == 'True', choices=((False, 'False'), (True, 'True')), widget=forms.RadioSelect ) class meta: model = MyModel
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)