Skip to content

Commit

Permalink
Fixed #8498 -- Add the ability to customize the template for app_inde…
Browse files Browse the repository at this point in the history
…x 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
  • Loading branch information
brosner committed Aug 23, 2008
1 parent 67402a6 commit 0511435
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/contrib/admin/sites.py
Expand Up @@ -47,6 +47,7 @@ class AdminSite(object):


index_template = None index_template = None
login_template = None login_template = None
app_index_template = None


def __init__(self): def __init__(self):
self._registry = {} # model_class class -> admin_class instance self._registry = {} # model_class class -> admin_class instance
Expand Down Expand Up @@ -397,7 +398,7 @@ def app_index(self, request, app_label):
raise http.Http404('The requested admin page does not exist.') raise http.Http404('The requested admin page does not exist.')
# Sort the models alphabetically within each app. # Sort the models alphabetically within each app.
app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name'])) 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)), 'title': _('%s administration' % capfirst(app_label)),
'app_list': [app_dict] 'app_list': [app_dict]
}, context_instance=template.RequestContext(request)) }, context_instance=template.RequestContext(request))
Expand Down

0 comments on commit 0511435

Please sign in to comment.