mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
Fix #841.
git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2256261ec5
commit
8a5327945f
@ -1,5 +1,6 @@
|
|||||||
{% extends "admin/base_site" %}
|
{% extends "admin/base_site" %}
|
||||||
{% load adminmedia %}
|
{% load adminmedia %}
|
||||||
|
{% load i18n %}
|
||||||
{% block extrahead%} <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/template_errors.css" /> {%endblock%}
|
{% block extrahead%} <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/template_errors.css" /> {%endblock%}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div>
|
<div>
|
||||||
|
@ -53,7 +53,6 @@ index = staff_member_required(index)
|
|||||||
class IncorrectLookupParameters(Exception):
|
class IncorrectLookupParameters(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ChangeList(object):
|
class ChangeList(object):
|
||||||
def __init__(self, request, app_label, module_name):
|
def __init__(self, request, app_label, module_name):
|
||||||
self.get_modules_and_options(app_label, module_name, request)
|
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)
|
result_list = lookup_mod.get_list(**lookup_params)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
result_list = p.get_page(page_num)
|
result_list = paginator.get_page(page_num)
|
||||||
except InvalidPage:
|
except InvalidPage:
|
||||||
result_list = []
|
result_list = []
|
||||||
(self.result_count, self.full_result_count, self.result_list,
|
(self.result_count, self.full_result_count, self.result_list,
|
||||||
|
@ -200,6 +200,7 @@ def dictsort(value, arg):
|
|||||||
Takes a list of dicts, returns that list sorted by the property given in
|
Takes a list of dicts, returns that list sorted by the property given in
|
||||||
the argument.
|
the argument.
|
||||||
"""
|
"""
|
||||||
|
print "ds:", type(value)
|
||||||
decorated = [(resolve_variable('var.' + arg, {'var' : item}), item) for item in value]
|
decorated = [(resolve_variable('var.' + arg, {'var' : item}), item) for item in value]
|
||||||
decorated.sort()
|
decorated.sort()
|
||||||
return [item[1] for item in decorated]
|
return [item[1] for item in decorated]
|
||||||
|
@ -18,8 +18,6 @@ class TemplateDebugMiddleware(object):
|
|||||||
origin, (start, end) = exception.source
|
origin, (start, end) = exception.source
|
||||||
template_source = origin.reload()
|
template_source = origin.reload()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
line = 0
|
line = 0
|
||||||
upto = 0
|
upto = 0
|
||||||
source_lines = []
|
source_lines = []
|
||||||
|
@ -25,7 +25,7 @@ def technical_500_response(request, exc_type, exc_value, tb):
|
|||||||
'filename' : filename,
|
'filename' : filename,
|
||||||
'function' : function,
|
'function' : function,
|
||||||
'lineno' : lineno,
|
'lineno' : lineno,
|
||||||
'vars' : tb.tb_frame.f_locals,
|
'vars' : tb.tb_frame.f_locals.items(),
|
||||||
'id' : id(tb),
|
'id' : id(tb),
|
||||||
'pre_context' : pre_context,
|
'pre_context' : pre_context,
|
||||||
'context_line' : context_line,
|
'context_line' : context_line,
|
||||||
@ -253,7 +253,7 @@ TECHNICAL_500_TEMPLATE = """
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for var in frame.vars.items|dictsort:"0" %}
|
{% for var in frame.vars|dictsort:"0" %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ var.0 }}</td>
|
<td>{{ var.0 }}</td>
|
||||||
<td class="code"><div>{{ var.1|pprint|escape }}</div></td>
|
<td class="code"><div>{{ var.1|pprint|escape }}</div></td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user