forms.TextInput(attrs={'class' : 'form-control',
}),
or
forms.Textarea(attrs={'class' : "form-control",
'rows' : 3 ,
})
to set widgets
but ModelChoiceField?
I have no idea,Django telled me "'module' object has no attribute 'ChoiceInput'"
when i use
forms.ChoiceInput
and "__init__() got an unexpected keyword argument 'attrs'" when i use ModelChoiceField
Can you help me?
Thank you very much?
Gategory = ModelChoiceField(queryset=GoodsType.objects.all())
widgets = {
'Gategory' : forms.Select(attrs={'class' : "form-control",
}),
}
-->>>
<select id="id_Category" name="Category">\n<option value="" selected="selected">---------</option>\n<option value="1">\u5168\u90e8</option>\n<option value="2">\U0001f436</option>\n</select>