﻿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
24411	"Creating a model called Item breaks the admin ""delete selected"" action"	Michael Angeletti	nobody	"{{{contrib/admin/templates/admin/includes/object_delete_summary.html}}} contains the following:

{{{
    {% for model_name, object_count in model_count.items %}
}}}

Given a model named {{{Item}}}, this breaks the admin's ""delete selected <model name>"" action. The reason for this is that {{{model_count}}} looks something like this:

{{{
    {'items': 1}
}}}

Because Django templates resolves {{{model_count.items}}} to {{{model_count['items']}}} (which, in the above example is {{{1}}}), this results in the template system trying to iterate an integer.

Now, using changing that line in the template to:

{{{
    {% for model_name, object_count in model_count.iteritems %}
}}}

fixes the issue, but due to [http://legacy.python.org/dev/peps/pep-0469/ PEP 469], this might not be the solution, and (I say jokingly, but for completion sake), what happens when I name my model {{{IterItem}}}?"	Uncategorized	new	Template system	master	Normal				Unreviewed	0	0	0	0	0	0
