【发布时间】:2018-01-10 06:45:17
【问题描述】:
我正在尝试为我的选择字段设置一个引导选择类。但是,我收到“TypeError: init() got an unexpected keyword argument 'attrs'”。
class constraintListForm1(forms.Form):
region = forms.ChoiceField(choices=REGION, required=True)
operator = forms.ChoiceField(choices=OPERATOR, required=True )
class META:
model = constraintListModel1
widgets = {
'region': forms.ChoiceField(attrs={'class' : 'bootstrap-select'}),
}
【问题讨论】:
标签: html django django-forms bootstrap-4 bootstrap-select