Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #218 -- Fixed admin change-list column sorting

git-svn-id: http://code.djangoproject.com/svn/django/trunk@333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f5b605ab1b0074ea8bdda0063bd9fad77a76ab45 1 parent 1d2ab36
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/views/admin/main.py
View
7 django/views/admin/main.py
@@ -103,9 +103,9 @@ def change_list(request, app_label, module_name):
ordering = meta.handle_legacy_orderlist(ordering)
if ordering[0].startswith('-'):
- order_field, order_type = ordering[0][1:], 'DESC'
+ order_field, order_type = ordering[0][1:], 'desc'
else:
- order_field, order_type = ordering[0], 'ASC'
+ order_field, order_type = ordering[0], 'asc'
if params.has_key(ORDER_VAR):
try:
try:
@@ -143,7 +143,8 @@ def change_list(request, app_label, module_name):
if isinstance(f.rel, meta.ManyToOne):
lookup_params['select_related'] = True
break
- lookup_params['order_by'] = ((order_type == 'DESC' and '-' or '') + lookup_order_field,)
+ lookup_params['order_by'] = ((order_type == 'desc' and '-' or '') + lookup_order_field,)
+ assert False, lookup_params['order_by']
if lookup_opts.admin.search_fields and query:
or_queries = []
for bit in query.split():
Please sign in to comment.
Something went wrong with that request. Please try again.