diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-11-19 15:07:42 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-11-19 15:07:42 +0000 |
| commit | be9376d9ad7ef6435867fdcbce2b1bf80973c8cf (patch) | |
| tree | adf0b0a9e52af3d5656d53d0bdb18bf80d610d0a /tests/regressiontests/admin_validation | |
| parent | 0880fe8be46df57e0f6c9ed7b4756688173da054 (diff) | |
Corrected a regression in validation of admin fieldsets with nested definitions from r11744. Thanks to Davor Lučić for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_validation')
| -rw-r--r-- | tests/regressiontests/admin_validation/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_validation/models.py b/tests/regressiontests/admin_validation/models.py index 1a34e4d30c..eb53a9dd6e 100644 --- a/tests/regressiontests/admin_validation/models.py +++ b/tests/regressiontests/admin_validation/models.py @@ -32,6 +32,8 @@ class Author(models.Model): class Book(models.Model): name = models.CharField(max_length=100) + subtitle = models.CharField(max_length=100) + price = models.FloatField() authors = models.ManyToManyField(Author, through='AuthorsBooks') @@ -131,6 +133,13 @@ Traceback (most recent call last): ... ImproperlyConfigured: 'FieldsetBookAdmin.fieldsets[1][1]['fields']' can't include the ManyToManyField field 'authors' because 'authors' manually specifies a 'through' model. +>>> class NestedFieldsetAdmin(admin.ModelAdmin): +... fieldsets = ( +... ('Main', {'fields': ('price', ('name', 'subtitle'))}), +... ) + +>>> validate(NestedFieldsetAdmin, Book) + # Regression test for #12209 -- If the explicitly provided through model # is specified as a string, the admin should still be able use # Model.m2m_field.through |
