summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_views/models.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-04-01 14:14:20 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-04-01 14:14:20 +0000
commitee17cabba0e1f2cbb85b2044eda43108e3f4371c (patch)
treefa5c3ade8c85aa0ca7cec09f9262646ab36c31a5 /tests/regressiontests/admin_views/models.py
parenta2dec37c413cc1b9fd205047e15602e4bc41de1f (diff)
Fixed #9969: choices with options groups (added in [7977]) now work correctly in the admin with list_display and list_filter. Thanks, ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_views/models.py')
-rw-r--r--tests/regressiontests/admin_views/models.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py
index e2d087db42..df533f82eb 100644
--- a/tests/regressiontests/admin_views/models.py
+++ b/tests/regressiontests/admin_views/models.py
@@ -135,6 +135,21 @@ class Thing(models.Model):
class ThingAdmin(admin.ModelAdmin):
list_filter = ('color',)
+class Fabric(models.Model):
+ NG_CHOICES = (
+ ('Textured', (
+ ('x', 'Horizontal'),
+ ('y', 'Vertical'),
+ )
+ ),
+ ('plain', 'Smooth'),
+ )
+ surface = models.CharField(max_length=20, choices=NG_CHOICES)
+
+class FabricAdmin(admin.ModelAdmin):
+ list_display = ('surface',)
+ list_filter = ('surface',)
+
class Person(models.Model):
GENDER_CHOICES = (
(1, "Male"),
@@ -283,6 +298,7 @@ admin.site.register(ExternalSubscriber, ExternalSubscriberAdmin)
admin.site.register(Podcast, PodcastAdmin)
admin.site.register(Parent, ParentAdmin)
admin.site.register(EmptyModel, EmptyModelAdmin)
+admin.site.register(Fabric, FabricAdmin)
# We intentionally register Promo and ChapterXtra1 but not Chapter nor ChapterXtra2.
# That way we cover all four cases: