Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7582: Removed checks that prevented null=True ForeignKey field…

…s from being sortable in Admin. Post queryset-refactor there seems no reason to disallow this.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fd366a85315dfc836e73f9cdee3e7309281dfd3e 1 parent 0ededc6
Karen Tracey authored September 21, 2008
6  django/contrib/admin/templatetags/admin_list.py
@@ -116,11 +116,7 @@ def result_headers(cl):
116 116
             # So this _is_ a sortable non-field.  Go to the yield
117 117
             # after the else clause.
118 118
         else:
119  
-            if isinstance(f.rel, models.ManyToOneRel) and f.null:
120  
-                yield {"text": f.verbose_name}
121  
-                continue
122  
-            else:
123  
-                header = f.verbose_name
  119
+            header = f.verbose_name
124 120
 
125 121
         th_classes = []
126 122
         new_order_type = 'asc'
3  django/contrib/admin/views/main.py
@@ -162,8 +162,7 @@ def get_ordering(self):
162 162
                     except AttributeError:
163 163
                         pass
164 164
                 else:
165  
-                    if not isinstance(f.rel, models.ManyToOneRel) or not f.null:
166  
-                        order_field = f.name
  165
+                    order_field = f.name
167 166
             except (IndexError, ValueError):
168 167
                 pass # Invalid ordering specified. Just use the default.
169 168
         if ORDER_TYPE_VAR in params and params[ORDER_TYPE_VAR] in ('asc', 'desc'):

0 notes on commit fd366a8

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