ChoiceFiled MultipleChoiceField ModelChoiceField ModelMultipleChoiceField
1、ChoiceFiled
单选 字段
2、MultipleChoiceField
多选
3、ModelChoiceField
单选 query_set
4、ModelMultipleChoiceField
多选 query_set
class BookForm(forms.Form): gender=forms.ChoiceField(choices=((1,"男"),(2,"女"))) publish=forms.ModelChoiceField(queryset=Publish.objects.all()) author=forms.ModelMultipleChoiceField(queryset=Author.objects.all())