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 21084,Wrong resolution of content type id for proxy models in ModelAdmin,alejandro,nobody,"I have a number of proxy models that I want to present separately in the admin interface. A simplified example would be: {{{ class Accommodation(models.Model): name = models.CharField(max_length=10) class Inn(Accommodation): class Meta: proxy = True class Hotel(Accommodation): class Meta: proxy = True admin.site.register(Inn) admin.site.register(Hotel) }}} However, due to how `ModelAdmin` gets the content type of the models the retrieved content type instances will always be those corresponding to `Accommodation`. This causes several problems: - The log entries shown in the admin index will have broken links because log entries have the content type id of `Accommodation` instead of `Inn` or `Hotel`. - In the change form, the `content_type_id` context variable will be the one of `Accommodation` content type, causing the ""View on site"" link not to work. I'm not sure wether there are more cases where getting the content type from the concrete model breaks things in the admin. A naive fix would be to pass `for_concrete_model=False` for every `ContentType.objects.get_for_model` call in `ModelAdmin` code but I'm not aware of the consequences of that since I'm not familiar enough with Django internals. ",Bug,closed,contrib.admin,1.5,Normal,fixed,,,Accepted,1,0,0,1,0,0