summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-27 05:57:10 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-27 05:57:10 +0000
commit6c7cf34d691ffe9ac2c9a7be8d2838b205ace757 (patch)
tree76ae4fab2793bb112e02c197ec5a30642f23abcd /tests/regressiontests
parentedabc4aca1d5f8ff081bbc0c94ad8eb6bcad28e9 (diff)
Fixed #9171 -- Fixed a few places where we were assuming lists instead of
generic sequences in ModelForm structures. Patch from mrmachine. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/inline_formsets/models.py2
-rw-r--r--tests/regressiontests/modeladmin/models.py8
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/inline_formsets/models.py b/tests/regressiontests/inline_formsets/models.py
index c00703852f..8b6f5dd342 100644
--- a/tests/regressiontests/inline_formsets/models.py
+++ b/tests/regressiontests/inline_formsets/models.py
@@ -51,5 +51,7 @@ Traceback (most recent call last):
Exception: <class 'regressiontests.inline_formsets.models.Child'> has no field named 'test'
+# Regression test for #9171.
+>>> ifs = inlineformset_factory(Parent, Child, exclude=('school',), fk_name='mother')
"""
}
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py
index f7526ab3dd..3a7d3f031f 100644
--- a/tests/regressiontests/modeladmin/models.py
+++ b/tests/regressiontests/modeladmin/models.py
@@ -123,6 +123,14 @@ displayed because you forgot to add it to fields/fielsets
>>> ma = BandAdmin(Band, site)
>>> ma.get_form(request).base_fields.keys()
['name', 'sign_date']
+
+# You can also pass a tuple to `exclude`.
+
+>>> class BandAdmin(ModelAdmin):
+... exclude = ('bio',)
+>>> ma = BandAdmin(Band, site)
+>>> ma.get_form(request).base_fields.keys()
+['name', 'sign_date']
# Using `fields` and `exclude`.