From 0511435a33d04491387ed50f7724b947fba11362 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Sat, 23 Aug 2008 16:27:12 +0000 Subject: [PATCH] Fixed #8498 -- Add the ability to customize the template for app_index similar to the other views on the AdminSite class. Thanks Jannis Leidel for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8487 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/sites.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index 81e43a19cc..4aa6975407 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -47,6 +47,7 @@ class AdminSite(object): index_template = None login_template = None + app_index_template = None def __init__(self): self._registry = {} # model_class class -> admin_class instance @@ -397,7 +398,7 @@ class AdminSite(object): raise http.Http404('The requested admin page does not exist.') # Sort the models alphabetically within each app. app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) - return render_to_response('admin/app_index.html', { + return render_to_response(self.app_index_template or 'admin/app_index.html', { 'title': _('%s administration' % capfirst(app_label)), 'app_list': [app_dict] }, context_instance=template.RequestContext(request))