Opened 5 years ago

Closed 5 years ago

Last modified 5 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 Changed 5 years ago by Tim Graham

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

comment:2 Changed 5 years ago by gayathri Menakath

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

comment:3 Changed 5 years ago by René Fleschenberg

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 Changed 5 years ago by Tim Graham

Has patch: set

comment:5 Changed 5 years ago by Tim Graham

Patch needs improvement: set

comment:6 Changed 5 years ago by René Fleschenberg

Patch needs improvement: unset

comment:7 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 2c727101:

Fixed #25531 -- Documented that admin_order_field supports lookups.

comment:8 Changed 5 years ago by Tim Graham <timograham@…>

In 85b56b8:

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

Backport of 2c727101113770d41e0907b333568bc2c25435e0 from master

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

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