Ticket #8498: ticket8498-r8486.1.diff

File ticket8498-r8486.1.diff, 988 bytes (added by Jannis Leidel, 16 years ago)

Small patch to add support for app_index_template

  • django/contrib/admin/sites.py

    diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
    index 81e43a1..4aa6975 100644
    a b class AdminSite(object):  
    4747
    4848    index_template = None
    4949    login_template = None
     50    app_index_template = None
    5051
    5152    def __init__(self):
    5253        self._registry = {} # model_class class -> admin_class instance
    class AdminSite(object):  
    397398                        raise http.Http404('The requested admin page does not exist.')
    398399        # Sort the models alphabetically within each app.
    399400        app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
    400         return render_to_response('admin/app_index.html', {
     401        return render_to_response(self.app_index_template or 'admin/app_index.html', {
    401402            'title': _('%s administration' % capfirst(app_label)),
    402403            'app_list': [app_dict]
    403404        }, context_instance=template.RequestContext(request))
Back to Top