Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #23250 -- Documented that ModelMultipleChoiceField queryset may…

… be None.
  • Loading branch information...
1 parent a2bcec3 commit ced3e303ca6c902c14d08b68806230ce04c71ff7 @timgraham timgraham committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 docs/ref/forms/fields.txt
11 docs/ref/forms/fields.txt
@@ -1048,6 +1048,17 @@ model object (in the case of ``ModelChoiceField``) or multiple model
objects (in the case of ``ModelMultipleChoiceField``) into the
``cleaned_data`` dictionary of the form.
+For more complex uses, you can specify ``queryset=None`` when declaring the
+form field and then populate the ``queryset`` in the form's ``__init__()``
+ class FooMultipleChoiceForm(forms.Form):
+ foo_select = forms.ModelMultipleChoiceField(queryset=None)
+ def __init__(self, *args, **kwargs):
+ super(FooMultipleChoiceForm, self).__init__(*args, **kwargs)
+ self.fields['foo_select'].queryset = ...

0 comments on commit ced3e30

Please sign in to comment.
Something went wrong with that request. Please try again.