#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 , 9 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 9 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
comment:4 by , 9 years ago
Has patch: | set |
---|
comment:5 by , 9 years ago
Patch needs improvement: | set |
---|
comment:6 by , 9 years ago
Patch needs improvement: | unset |
---|
Note:
See TracTickets
for help on using tickets.
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 :)