Opened 18 years ago

Closed 13 years ago

#2679 closed Bug (fixed)

Admin.ordering isn't working for edit_inline ForeignKey fields

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

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.

Change History (4)

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Summary: Admin.ordering isn't working for inlined ForeignKey relationshipsAdmin.ordering isn't working for edit_inline ForeignKey fields
Triage Stage: UnreviewedAccepted

comment:2 by Ramiro Morales, 14 years ago

Ability to respect its own ordering option was added to InlineModelAdmin (and children) in r14882 so I'm closing this ticket as fixed although it reported the issue against to the equivalent inline implementation available at that time (inner Admin class).

comment:3 by Łukasz Rekucki, 14 years ago

Severity: normalNormal
Type: defectBug

comment:4 by Julien Phalip, 13 years ago

Easy pickings: unset
Resolution: fixed
Status: newclosed
UI/UX: unset

Closing as fixed as per Ramiro's comment.

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