Ticket #930: ordering_foreignkey.diff
File ordering_foreignkey.diff, 699 bytes (added by , 19 years ago) |
---|
-
django/contrib/admin/views/main.py
203 203 f = lookup_opts.get_field(order_field) 204 204 rel_ordering = f.rel.to.ordering and f.rel.to.ordering[0] or f.rel.to.pk.column 205 205 lookup_order_field = '%s.%s' % (f.rel.to.db_table, rel_ordering) 206 lookup_params['select_related'] = True 206 207 # Use select_related if one of the list_display options is a field with a 207 208 # relationship. 208 209 if lookup_opts.admin.list_select_related: