Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13862 closed (fixed)

InlineModelAdmin does not respect ordering

Reported by: DrMeers Owned by: cogat
Component: contrib.admin Version: master
Severity: Keywords: InlineModelAdmin, inline, ordering, sprintdec2010
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

ModelAdmin has an ordering option which ought to be inherited by InlineModelAdmin -- in many situations it is useful to specify a custom ordering criteria for inlines. I've attached a patch which moves the ordering attribute and queryset method should to BaseModelAdmin so that the functionality is shared with InlineModelAdmin.

Attachments (3)

inline_queryset_ordering.diff (2.4 KB) - added by DrMeers 5 years ago.
inline_queryset_ordering_2.diff (6.3 KB) - added by rasca 5 years ago.
added docs and tests
inline_queryset_ordering_2_and_docs_correction.diff (9.2 KB) - added by cogat 5 years ago.
Added docs corrections from #14816.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by DrMeers

comment:1 Changed 5 years ago by dmoisset

  • Needs documentation set
  • Needs tests set
  • Owner changed from DrMeers to dmoisset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Accepting this; however inlines should explicitly document that these new options are available

comment:2 Changed 5 years ago by dmoisset

  • Owner changed from dmoisset to nobody

comment:3 Changed 5 years ago by rasca

  • Needs documentation unset
  • Needs tests unset
  • Triage Stage changed from Accepted to Ready for checkin

The patch works fine for me, added docs, tests and marking it RFC

Changed 5 years ago by rasca

added docs and tests

comment:4 Changed 5 years ago by cogat

  • Owner changed from nobody to cogat

Changed 5 years ago by cogat

Added docs corrections from #14816.

comment:5 follow-up: Changed 5 years ago by cogat

  • Keywords sprintdec2010 added

I've updated the docs to reflect the corrections in #14816. Some InlineModelAdmin attributes had duplicate docs to ModelAdmin; these are changed to links for consistency.

comment:6 in reply to: ↑ 5 Changed 5 years ago by cogat

Replying to cogat:

I've updated the docs to reflect the corrections in #14816. Some InlineModelAdmin attributes had duplicate docs to ModelAdmin; these are changed to links for consistency.

#14816 is closed in favour of the patch here.

comment:7 Changed 5 years ago by jezdez

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

(In [14882]) Fixed #13862 -- Added an ordering option to InlineModelAdmin and cleaned up documentation for it a bit. Thanks, Simon Meers, rasca and cogat.

comment:8 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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