I want my ChoiceField in ModelForm to have a blank option (------) but it\'s required.
I need to have blank option to prevent user from accidentally skipping the field t
You can also override form's __init__()
method and modify the choices
field attribute, reasigning a new list of tuples. (This may be useful for dynamic changes):
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
self.fields['my_field'].choices = [('', '---------')] + self.fields['my_field'].choices