From 6a36699818e9c90edc0acfdb026522dcf913ba58 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 27 Nov 2005 20:25:56 +0000 Subject: [PATCH] Fixed #917 -- Made admin change_list view overridable by custom templates git-svn-id: http://code.djangoproject.com/svn/django/trunk@1468 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templates/admin/change_list.html | 10 +++++----- django/contrib/admin/views/main.py | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index b2b680add4b..188b0639e74 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -9,11 +9,11 @@ {% endif %}
-{% search_form cl %} -{% date_hierarchy cl %} -{% filters cl %} -{% result_list cl %} -{% pagination cl %} +{% block search %}{% search_form cl %}{% endblock %} +{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %} +{% block filters %}{% filters cl %}{% endblock %} +{% block result_list %}{% result_list cl %}{% endblock %} +{% block pagination %}{% pagination cl %}{% endblock %}
{% endblock %} diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 0c1baccc65a..584b08af935 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -241,15 +241,14 @@ def change_list(request, app_label, module_name): 'is_popup': cl.is_popup, 'cl' : cl }) - c.update( { 'has_add_permission': c['perms'][app_label][cl.opts.get_add_permission()]}), - return render_to_response('admin/change_list', - context_instance = c) + c.update({'has_add_permission': c['perms'][app_label][cl.opts.get_add_permission()]}), + return render_to_response(['admin/%s/%s/change_list' % (app_label, cl.opts.object_name.lower()), + 'admin/%s/change_list' % app_label, + 'admin/change_list'], context_instance=c) change_list = staff_member_required(change_list) - use_raw_id_admin = lambda field: isinstance(field.rel, (meta.ManyToOne, meta.ManyToMany)) and field.rel.raw_id_admin - def get_javascript_imports(opts,auto_populated_fields, ordered_objects, field_sets): # Put in any necessary JavaScript imports. js = ['js/core.js', 'js/admin/RelatedObjectLookups.js']