Opened 14 years ago
Closed 14 years ago
#17128 closed Bug (fixed)
Python 2.5-incompatible change in r16319 -- ModelAdmin.list_display.index method called
| Reported by: | Simon Meers | Owned by: | Simon Meers |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Normal | Keywords: | python 2.5, tuple, index, list_display |
| 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
r16319 introduced a python 2.5-incompatible change in which ModelAdmin.list_display's index method is called despite the fact that it is likely a tuple (which only has an index method in 2.6+).
I imagine this managed to hide for so long because:
- No tests failed -- some use lists for list_display, and most don't have
orderingset on theModelAdminorModel.Meta ChangeListsfor which actions were present (which they are by default) have theirlist_displaylistified whenaction_checkboxis prepended (bypassed if rendering theresult_listwithout usingchangelist_view)- The number of people using Django trunk with Python 2.5 are no doubt a minority
I've attached a patch which addresses the issue and includes regression tests, which I'll commit unless someone thinks it could be done better.
Attachments (1)
Change History (3)
by , 14 years ago
| Attachment: | 17128.diff added |
|---|
comment:1 by , 14 years ago
| Triage Stage: | Unreviewed → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
This looks good to me.