Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored July 28, 2005

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  django/views/admin/main.py
7  django/views/admin/main.py
@@ -103,9 +103,9 @@ def change_list(request, app_label, module_name):
103 103
     ordering = meta.handle_legacy_orderlist(ordering)
104 104
 
105 105
     if ordering[0].startswith('-'):
106  
-        order_field, order_type = ordering[0][1:], 'DESC'
  106
+        order_field, order_type = ordering[0][1:], 'desc'
107 107
     else:
108  
-        order_field, order_type = ordering[0], 'ASC'
  108
+        order_field, order_type = ordering[0], 'asc'
109 109
     if params.has_key(ORDER_VAR):
110 110
         try:
111 111
             try:
@@ -143,7 +143,8 @@ def change_list(request, app_label, module_name):
143 143
             if isinstance(f.rel, meta.ManyToOne):
144 144
                 lookup_params['select_related'] = True
145 145
                 break
146  
-    lookup_params['order_by'] = ((order_type == 'DESC' and '-' or '') + lookup_order_field,)
  146
+    lookup_params['order_by'] = ((order_type == 'desc' and '-' or '') + lookup_order_field,)
  147
+    assert False, lookup_params['order_by']
147 148
     if lookup_opts.admin.search_fields and query:
148 149
         or_queries = []
149 150
         for bit in query.split():

0 notes on commit f5b605a

Please sign in to comment.
Something went wrong with that request. Please try again.