﻿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	Tim Graham	"{{{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, changing the offending line in the template to:

{{{
    {% for model_name, object_count in model_count.iteritems %}
}}}

incidentally addresses 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}}}?"	Bug	closed	contrib.admin	1.8alpha1	Release blocker	fixed			Accepted	1	0	0	0	0	0
