﻿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
5392	[newforms-admin] - hooks for template names	Petr Marhoun <petr.marhoun@…>	nobody	"I think it is possible to have more admin sites in one project. And it would be nice to have different default templates for these two sites - these templates should be independent on application.

So I would like to have some hooks as changelist_templates, add_templates and so on. For example this code could be changed:

{{{
#!python

class ModelAdmin(BaseModelAdmin):

    def changelist_view(self, request):
        ### ...
        return render_to_response(['admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
                                'admin/%s/change_list.html' % app_label,
                                'admin/change_list.html'], context_instance=c)

}}}

New variant:

{{{
#!python

class ModelAdmin(BaseModelAdmin):

    def changelist_view(self, request):
        ### ...
        return render_to_response(self.changelist_templates(app_label, opts.object_name.lower()), context_instance=c)

    def changelist_templates(self, app_label, object_label):
        return ['admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
            'admin/%s/change_list.html' % app_label,
            'admin/change_list.html']


}}}

I haven't need it yet so I have no patch. But it is no problem for me to create it - if you think it is a good idea.
"		closed	contrib.admin	newforms-admin		fixed	nfa-someday		Design decision needed	0	0	0	1	0	0
