Ticket #4926: ordering_patch_main.py.diff

File ordering_patch_main.py.diff, 517 bytes (added by Glin <glin@…>, 17 years ago)
  • main.py

     
    428428                qs = qs.select_related()
    429429
    430430        # Set ordering.
    431         qs = qs.order_by(order_type + lookup_order_field)
     431        ordering = self.model_admin.ordering or self.lookup_opts.ordering or ()
     432        qs = qs.order_by(order_type + lookup_order_field, *ordering)
    432433
    433434        # Apply keyword searches.
    434435        def construct_search(field_name):
Back to Top