1
You should replace your ChoiceField
with a ModelChoiceField
. They allow you to specify a queryset to populate the choices.
category = forms.ModelChoiceField(queryset=Category.objects.all(), empty_label="(Nothing)")
Source:stackexchange.com
1
You should replace your ChoiceField
with a ModelChoiceField
. They allow you to specify a queryset to populate the choices.
category = forms.ModelChoiceField(queryset=Category.objects.all(), empty_label="(Nothing)")