1๐
โ
I hope Iโm getting this right, but Iโm guessing that even with the empty_label
set to None
you are still seeing the first category in the list selected.
When you override a ModelForm
field, like you do now for category_parent
, you lose the automatically connected required=False
form correspondent for the blank=True
in the model.
Try adding required=False
to the form field, like this:
category_parent = forms.ModelChoiceField(queryset=Category.objects.all(), empty_label='None', required=False)
๐คAndrei Avram
Source:stackexchange.com