Django

Code

Ticket #2679 (new)

Opened 2 years ago

Last modified 2 years ago

Admin.ordering isn't working for edit_inline ForeignKey fields

Reported by: treborhudson@gmail.com Assigned to: nobody
Milestone: Component: django.contrib.admin
Version: Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Note: I've only tested this with "backward" foreign keys. This does work with Meta.ordering but I don't want this ordering to happen on queries outside of the admin so I moved the ordering property to the "class Admin" and the ordering isn't working. I've verified that the SQL queries are not adding the "ORDER BY" clause by adding this to the admin base.html template:

<!-- SQL Queries --> <!-- {% for s in sql_queries %} SQL: {{ s.sql }} TIME: {{ s.time }} {% endfor %} // -->

If a test case is needed I could provide a simple model for this.

Attachments

Change History

02/17/07 22:39:57 changed by Gary Wilson <gary.wilson@gmail.com>

  • summary changed from Admin.ordering isn't working for inlined ForeignKey relationships to Admin.ordering isn't working for edit_inline ForeignKey fields.
  • stage changed from Unreviewed to Accepted.

Add/Change #2679 (Admin.ordering isn't working for edit_inline ForeignKey fields)




Change Properties
Action