Opened 13 years ago

Closed 13 years ago

#17090 closed Bug (fixed)

Problems with ModelAdmin.get_list_display()

Reported by: Julien Phalip Owned by: nobody
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

While working on #16257 I've noticed some problems with the ModelAdmin.get_list_display() method that was introduced in r16340:

  • There is an inconsistency with list_display. If you set list_display to ('bacon', 'cheese',) then get_list_display() will return ('action_checkbox', 'bacon', 'cheese',).
  • The presence (or absence) of the action checkbox should be dictated solely by the presence (or absence) of ModelAdmin.actions, not by what is returned by get_list_display().

The attached patch rectifies this behavior by injecting 'action_checkbox' further downstream after 'get_list_display()' is called. This would be a minor backwards-incompatibility for those who have been using the still-unreleased 'get_list_display()' method.

Attachments (1)

17090.get_list_display-action_checkbox.diff (4.8 KB ) - added by Julien Phalip 13 years ago.

Download all attachments as: .zip

Change History (3)

by Julien Phalip, 13 years ago

comment:1 by Ramiro Morales, 13 years ago

Triage Stage: UnreviewedReady for checkin
Version: 1.3SVN

comment:2 by Julien Phalip, 13 years ago

Resolution: fixed
Status: newclosed

In [17035]:

Fixed #17090 -- Made the API specification for ModelAdmin.get_list_display() more consistent with that of ModelAdmin.list_display by separating out the admin action check boxes business. This is backwards-incompatible for those who have been using the still-unreleased get_list_display() method. Thanks to Ramiro Morales for the review.

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