﻿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
27709	ContentTypes.objects.get_for_models returns inconsistent results for proxy models	Peter Inglesby	nobody	"If `UserProxy` is a proxy model, then the result of calling `ContentTypes.objects.get_for_models(UserProxy)` depends on whether the content types cache is empty:

{{{
>>> ContentType.objects.clear_cache()
>>> ContentType.objects.get_for_models(UserProxy)
{<class 'django.contrib.auth.models.User'>: <ContentType: user>}
>>> ContentType.objects.get_for_models(UserProxy)
{<class 'gallery.models.UserProxy'>: <ContentType: user>}
}}}

In particular, on the first call to `get_for_models`, the key in the results dictionary is the concrete model, while on subsequent calls it is the proxy model.

I believe the correct behaviour is to return the proxy model as the key.

I have two proposed fixes, each with pros and cons.  Should I open two separate pull requests?"	Bug	closed	contrib.contenttypes	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
