#26405: ModelMultipleChoiceField does not honor to_field_name at render
----------------------------+-------------------------
Reporter: drepo | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.9
Severity: Normal | Keywords: model-forms
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+-------------------------
Steps to reproduce:
1) Clone the repo (sample Django project which reproduces the bug) at
https://github.com/drepo/model-multi-render
2) Install requirements.txt (preferably in a virtualenv)
3) Run the migrations
4) ./manage.py loaddata --app demo initial_data.json (Load fixtures --
sample data)
5) Visit http://localhost:8000/demo-working/1 -- Notice all items in
contents are selected. This is expected.
6) Visit http://localhost:8000/demo/1 -- Notice all items in contents are
unselected. This is NOT expected.
The difference between (5) and (6) is the `form_class` used in the view
for (6) uses a `to_field_name` parameter which is not `id`.
Python: 3.4,
Linux Mint 17,
Django 1.9.4
--
Ticket URL: <https://code.djangoproject.com/ticket/26405>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.e81fa62eb810ea886fa676c171671975%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.