Ticket #2895: main.diff
File main.diff, 807 bytes (added by , 18 years ago) |
---|
-
main.py
706 706 # For OneToOneFields, don't try to order by the related object's ordering criteria. 707 707 pass 708 708 elif isinstance(f.rel, models.ManyToOneRel): 709 rel_ordering = f.rel.to._meta.ordering and f.rel.to._meta.ordering[0] or f.rel.to._meta.pk.column 709 o_field = f.rel.to._meta.ordering[0] 710 if o_field[0] == '-': 711 o_field = o_field[1:] 712 rel_ordering = f.rel.to._meta.ordering and o_field or f.rel.to._meta.pk.column 710 713 lookup_order_field = '%s.%s' % (f.rel.to._meta.db_table, rel_ordering) 711 714 712 715 # Set ordering.