I’m on Django 1.2. I’m trying to use the ModelChoiceField in a form. Why are these failing with the above error message? I’m at a loss 🙁
class QueueForm(forms.Form):
queue = forms.ModelChoiceField(query_set=Order.objects.all())
I also tried this:
class QueueForm(forms.Form):
queue = forms.ModelChoiceField(query_set=Order.objects.all(),required=False)
And got:
__init__() takes at least 2 arguments (2 given)
It seems to be saying this is happening on the queue = .. line. Before I even use the form.
You’re setting the wrong variable name in the constructor, it needs to be queryset and not query_set. Try this: