Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25531 closed Cleanup/optimization (fixed)

Document the fact that admin_order_field allows query lookups

Reported by: René Fleschenberg Owned by: gayathri Menakath
Component: Documentation Version: 1.8
Severity: Normal Keywords: admin_order_field sort related list_display
Cc: gayathrimenakath@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

You can use query lookups in admin_order_field, but this is not documented.

This allows to use list_display to sort by values of related fields.

See, for example http://mihasya.com/blog/django-admin-sorting-on-related-objects-property/

Change History (9)

comment:1 by Tim Graham, 9 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by gayathri Menakath, 9 years ago

Cc: gayathrimenakath@… added
Owner: changed from René Fleschenberg to gayathri Menakath
Status: newassigned

comment:3 by René Fleschenberg, 9 years ago

I had some spare time today and took the liberty to submit a pull request for this (5608). I hope you don't mind, Gayathrimenakath :)

comment:4 by Tim Graham, 9 years ago

Has patch: set

comment:5 by Tim Graham, 9 years ago

Patch needs improvement: set

comment:6 by René Fleschenberg, 9 years ago

Patch needs improvement: unset

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 2c727101:

Fixed #25531 -- Documented that admin_order_field supports lookups.

comment:8 by Tim Graham <timograham@…>, 9 years ago

In 85b56b8:

[1.9.x] Fixed #25531 -- Documented that admin_order_field supports lookups.

Backport of 2c727101113770d41e0907b333568bc2c25435e0 from master

comment:9 by Tim Graham <timograham@…>, 9 years ago

In 058f604:

[1.8.x] Fixed #25531 -- Documented that admin_order_field supports lookups.

Backport of 2c727101113770d41e0907b333568bc2c25435e0 from master

Note: See TracTickets for help on using tickets.
Back to Top