[Django] #30247: ModelMultipleChoiceField Bug - Initial Values has to be in queryset, does not make sense

1 view
Skip to first unread message

Django

unread,
Mar 12, 2019, 5:25:11 AM3/12/19
to django-...@googlegroups.com
#30247: ModelMultipleChoiceField Bug - Initial Values has to be in queryset, does
not make sense
-------------------------------------+-------------------------------------
Reporter: Josef | Owner: nobody
Korbel |
Type: | Status: new
Uncategorized |
Component: | Version: 2.1
Uncategorized | Keywords:
Severity: Normal | ModelMultipleChoiceField
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When using ModelMultipleChoiceField, the initial values need to be in the
queryset, or the widget will be empty. As my queryset is collection of
unassigned objects, my initial will never by in my queryset, thus making
this undoable for me, here are more details on SO.

https://stackoverflow.com/questions/54941814/django-
modelmultiplechoicefield-1n-initial/54998957#54998957

--
Ticket URL: <https://code.djangoproject.com/ticket/30247>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 12, 2019, 5:26:34 AM3/12/19
to django-...@googlegroups.com
#30247: ModelMultipleChoiceField Bug - Initial Values has to be in queryset, does
not make sense
-------------------------------------+-------------------------------------
Reporter: Josef Korbel | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
ModelMultipleChoiceField | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Josef Korbel):

* component: Uncategorized => Forms
* type: Uncategorized => Bug


--
Ticket URL: <https://code.djangoproject.com/ticket/30247#comment:1>

Django

unread,
Mar 12, 2019, 6:18:38 AM3/12/19
to django-...@googlegroups.com
#30247: ModelMultipleChoiceField Bug - Initial Values has to be in queryset, does
not make sense
-------------------------------------+-------------------------------------
Reporter: Josef Korbel | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: 2.1
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage:
ModelMultipleChoiceField | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => invalid


Comment:

You've misunderstood what's going on here. `queryset` in this case means
the set of allowed values. All values, whether initial or not, must be in
`queryset`.

If you're not clear on this please see
TicketClosingReasons/UseSupportChannels.

--
Ticket URL: <https://code.djangoproject.com/ticket/30247#comment:2>

Reply all
Reply to author
Forward
0 new messages