Ticket #7582: nullorder.diff
File nullorder.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
99 99 # So this _is_ a sortable non-field. Go to the yield 100 100 # after the else clause. 101 101 else: 102 if isinstance(f.rel, models.ManyToOneRel) and f.null: 103 yield {"text": f.verbose_name} 104 continue 105 else: 106 header = f.verbose_name 102 header = f.verbose_name 107 103 108 104 th_classes = [] 109 105 new_order_type = 'asc' -
django/contrib/admin/views/main.py
175 175 except AttributeError: 176 176 pass 177 177 else: 178 if not isinstance(f.rel, models.ManyToOneRel) or not f.null: 179 order_field = f.name 178 order_field = f.name 180 179 except (IndexError, ValueError): 181 180 pass # Invalid ordering specified. Just use the default. 182 181 if ORDER_TYPE_VAR in params and params[ORDER_TYPE_VAR] in ('asc', 'desc'):