#9969 closed (fixed)
Admin changelist table field and list_filter section broken when field value has been chosen from a choices named group
Reported by: | Ramiro Morales | Owned by: | Ramiro Morales |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | change list choices columns (None) named groups select dropdown | |
Cc: | Joshua Cender | 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
After [7977], with this setup:
#models.py from django.db import models CAT_CHOICES = ( ('Outer 1', ( ('option1', 'Inner 1'), ('option2', 'Inner 2'), ) ), ('normal', 'Normal no nested value'), ) class Item(models.Model): name = models.CharField(max_length=60) category = models.CharField("Item Category", max_length=30, choices=CAT_CHOICES)
# admin.py from t9969.models import Item from django.contrib import admin class ItemAdmin(admin.ModelAdmin): list_display = ('name', 'category',) admin.site.register(Item, ItemAdmin)
After adding some Items choosing each of the three available Category field values offered by the select widget, the change list shows None()
for the instances with the values 'option1'
and 'option2'
(should be 'Inner 1' and 'Inner 2' respectively), 'Normal no nested value'
shows correctly.
Attachments (8)
Change History (20)
by , 16 years ago
Attachment: | t9969-r9701.diff added |
---|
comment:1 by , 16 years ago
Has patch: | set |
---|---|
Needs tests: | set |
comment:3 by , 16 years ago
Needs tests: | unset |
---|---|
Owner: | changed from | to
comment:4 by , 16 years ago
I've updated/fixed the patch:
- The previous patch contained only the regression tests, I've fixed that now by including the actual code fix too.
- Updated to current trunk status, more specifically the mods to the
admin_views
regression tests were adapted to post [9739]
comment:6 by , 16 years ago
Summary: | Admin change list view shows (None) instead of the real field value when it has been chosen from a choices named group → Admin changelist table field and list_filter section broken when field value has been chosen from a choices named group |
---|
by , 16 years ago
Attachment: | no-hierarchy-no-category-names.png added |
---|
screenshot showing problem with changelist field
by , 16 years ago
Attachment: | list_filter_bug.png added |
---|
screenshot showing problem with list_filter section
by , 16 years ago
Attachment: | 9969-admin-bugs-with-nested-choices-r9905.diff added |
---|
Updated patch includes fixes for poblems in changelist tabel and in filter section, includes tests
comment:7 by , 16 years ago
Cc: | added |
---|
comment:8 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 16 years ago
Attachment: | 9969-admin-bugs-with-nested-choices-r10283.diff added |
---|
Patch updated to apply cleanly to trunk as of r10283
comment:9 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Patch thta fixes the issue, no tests yet