From 8a5327945fbdf33c2578c1392dda77a01941d119 Mon Sep 17 00:00:00 2001 From: Robert Wittams Date: Sat, 19 Nov 2005 05:17:50 +0000 Subject: [PATCH] Fix #841. git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1288 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templates/admin/template_debug.html | 1 + django/contrib/admin/views/main.py | 3 +-- django/core/template/defaultfilters.py | 1 + django/middleware/template_debug.py | 2 -- django/views/debug.py | 4 ++-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/django/contrib/admin/templates/admin/template_debug.html b/django/contrib/admin/templates/admin/template_debug.html index 433b565aa0..d0fdf96ee1 100644 --- a/django/contrib/admin/templates/admin/template_debug.html +++ b/django/contrib/admin/templates/admin/template_debug.html @@ -1,5 +1,6 @@ {% extends "admin/base_site" %} {% load adminmedia %} +{% load i18n %} {% block extrahead%} {%endblock%} {% block content %}
diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 3d8d896460..1a57aacbbb 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -53,7 +53,6 @@ index = staff_member_required(index) class IncorrectLookupParameters(Exception): pass - class ChangeList(object): def __init__(self, request, app_label, module_name): self.get_modules_and_options(app_label, module_name, request) @@ -152,7 +151,7 @@ class ChangeList(object): result_list = lookup_mod.get_list(**lookup_params) else: try: - result_list = p.get_page(page_num) + result_list = paginator.get_page(page_num) except InvalidPage: result_list = [] (self.result_count, self.full_result_count, self.result_list, diff --git a/django/core/template/defaultfilters.py b/django/core/template/defaultfilters.py index 3a25add5e1..7f891af5ba 100644 --- a/django/core/template/defaultfilters.py +++ b/django/core/template/defaultfilters.py @@ -200,6 +200,7 @@ def dictsort(value, arg): Takes a list of dicts, returns that list sorted by the property given in the argument. """ + print "ds:", type(value) decorated = [(resolve_variable('var.' + arg, {'var' : item}), item) for item in value] decorated.sort() return [item[1] for item in decorated] diff --git a/django/middleware/template_debug.py b/django/middleware/template_debug.py index b31f32e328..14da1cb18b 100644 --- a/django/middleware/template_debug.py +++ b/django/middleware/template_debug.py @@ -18,8 +18,6 @@ class TemplateDebugMiddleware(object): origin, (start, end) = exception.source template_source = origin.reload() - - line = 0 upto = 0 source_lines = [] diff --git a/django/views/debug.py b/django/views/debug.py index 0ddaa44a7f..4aece9443d 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -25,7 +25,7 @@ def technical_500_response(request, exc_type, exc_value, tb): 'filename' : filename, 'function' : function, 'lineno' : lineno, - 'vars' : tb.tb_frame.f_locals, + 'vars' : tb.tb_frame.f_locals.items(), 'id' : id(tb), 'pre_context' : pre_context, 'context_line' : context_line, @@ -253,7 +253,7 @@ TECHNICAL_500_TEMPLATE = """ - {% for var in frame.vars.items|dictsort:"0" %} + {% for var in frame.vars|dictsort:"0" %} {{ var.0 }}
{{ var.1|pprint|escape }}