Opened 10 years ago

Closed 10 years ago

#24417 closed New feature (fixed)

Add ModelAdmin.get_list_select_related()

Reported by: Anshuman Aggarwal Owned by: Loek van Gent
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since other list options such as list_display has a corresponding dynamic function such as get_list_display, select_related should have the same to dynamically specify the related models to retrieve.

Use case: If you dynamically include foreign key columns in list_display, then you would like the ability to dynamically specify the select_related also. Otherwise the queries are not as efficient as select_related allows them to be.

Change History (6)

comment:1 by Anshuman Aggarwal, 10 years ago

Type: UncategorizedBug

Marking as a bug since it feels that the API is inconsistent with the rest and its an easy win.

comment:2 by Tim Graham, 10 years ago

Component: Uncategorizedcontrib.admin
Summary: Django admin opton get_list_select_related is missingAdd ModelAdmin.get_list_select_related()
Triage Stage: UnreviewedAccepted
Type: BugNew feature
Version: 1.7master

comment:3 by Loek van Gent, 10 years ago

Owner: changed from nobody to Loek van Gent
Status: newassigned

comment:4 by Marten Kenbeek, 10 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Collin Anderson, 10 years ago

Has patch: set

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

Resolution: fixed
Status: assignedclosed

In 35b3158:

Fixed #24417 -- Added ModelAdmin.get_list_select_related()

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