﻿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
27001	Regression in query counts using RadioSelect with ModelChoiceField	Alex Hill	nobody	"Before 1.9, I had on my list of things to look at the fact that a standard ModelChoiceField with a RadioSelect takes two queries. Now looking at this in 1.10, the number of queries has ballooned (to 11 queries in my simple test case).

I've not got far in looking for a solution, but this test passes in 1.9 and fails in 1.10 and master with `AssertionError: 11 != 2 : 11 queries executed, 2 expected`:

{{{#!python
    def test_radioselect_num_queries(self):
        class CategoriesForm(forms.Form):
            categories = forms.ModelChoiceField(
                queryset=Category.objects.all(),
                widget=forms.RadioSelect
            )

        template = Template('{% for w in form.categories %}{{ w }}{% endfor %}')

        with self.assertNumQueries(2):
            template.render(Context({'form': CategoriesForm()}))
}}}
"	Bug	closed	Forms	1.10	Release blocker	fixed			Accepted	1	0	0	0	0	0
