﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26405	ModelMultipleChoiceField does not honor to_field_name at render	drepo	nobody	"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
"	Bug	closed	Forms	1.9	Normal	duplicate	model-forms		Unreviewed	0	0	0	0	0	0
