Ticket #5057: admin_ordering.diff
File admin_ordering.diff, 739 bytes (added by , 17 years ago) |
---|
-
django/contrib/admin/views/main.py
729 729 pass 730 730 elif isinstance(f.rel, models.ManyToOneRel): 731 731 rel_ordering = f.rel.to._meta.ordering and f.rel.to._meta.ordering[0] or f.rel.to._meta.pk.column 732 if rel_ordering.startswith('-'): 733 rel_ordering = rel_ordering[1:] 734 self.order_type = (self.order_type == 'desc' and 'asc' or 'desc') 732 735 lookup_order_field = '%s.%s' % (f.rel.to._meta.db_table, rel_ordering) 733 736 734 737 # Set ordering.