Code

Opened 3 years ago

Closed 3 years ago

#15629 closed Bug (duplicate)

django admin does not use ordering for foreign keys dropdown

Reported by: brillgen Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Versions: Admin of 1.2 as well as the 1.3 RC
Conditions:Model 2 has FK to Model 1. Model 1 has an ordering parameter (used in list display).

Expected Behavior: ordering should be used for showing the dropdown in Model 2
Acual Behaviour: dropdown in Model 2 for items in Model 1 shows in model meta sorting order

Reason: if the model meta sort order is used all queries have an extra overhead. Since the admin is just using an ordering parameter that it itself uses for the list display, there is no overhead or incongruity.

This can always be an additional parameter of course.

I would be happy to try and submit a patch against the 1.3rc as long as the community can bless this as a valid bug/enhancement that will be accepted into django main.

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by russellm

  • milestone 1.3 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

This isn't going to get into 1.3 -- we're trying to stabilize so that we can make a release, and this is a minor annoyance that has (evidently) existed for a long time.

However, it sounds like a reasonable complaint; a patch would certainly be welcome.

comment:2 Changed 3 years ago by lukeplant

  • Type set to Bug

comment:3 Changed 3 years ago by lukeplant

  • Severity set to Normal

comment:4 Changed 3 years ago by julien

  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #6585.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.