python - Populate ChoiceField from database -
I like many fields in my form which are being provided as favorites that get their contents from the database Are there.
I was thinking like something:
class series form: Series = forms. Chargefield (option = Series.object.all ()) class meta: model = series exclusion = ('model', 'date_ added',)
but area series
Now I do not see it in my form. What am I missing?
After trying the solution (using ModelChoiceField
), I'm still seeing the same problem. Here's my code:
series = forms.ModelChoiceField (queryset = series.objects.values ('series'), empty_label = "")
Use instead.
Comments
Post a Comment