﻿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
5247	ModelMultipleChoiceField doesn't select initial choices	uhlr@…	Alex Robbins	"When using a ModelMultipleChoiceField, initial values are not selected.  After some investigation, I discovered that this was because SelectMultiple.render() was comparing the primary key of the choices to the unicode string of each value; this obviously only works if one's model returns the primary key, which is near-universally suboptimal.

I have modified SelectMultiple to call a method value_to_str() (perhaps not the best name) which defaults to returning the force_unicode() of the value; I've added a subclass ModelSelectMultiple which overrides this to return SelectMultiple.value_to_str(value._get_pk_val()).  Finally, I modified ModelMultipleChoiceField to use a ModelSelectMultiple widget rather than a SelectMultiple.

This does what's expected, and is extensible in the future."		closed	Forms	dev		worksforme	ModelMultipleChoiceField SelectMultiple		Accepted	1	0	1	1	0	0
