How do i remove the default --------- choice from ModelChoiceField?
+6
A:
Use empty_label=None
field2 = forms.ModelChoiceField(queryset=..., empty_label=None)
Please check the doc for ModelChoiceField
celopes
2009-12-08 16:53:20
Also note that if the field is required and has a default value, the empty option will automatically be removed.
Carl Meyer
2009-12-09 02:36:26