summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Hurley <gabehr@gmail.com>2010-10-10 22:41:51 +0000
committerGabriel Hurley <gabehr@gmail.com>2010-10-10 22:41:51 +0000
commit1b7d73848c7260e87c3e4c5a0548a36bcd1f520b (patch)
tree42c3d62acdf5dec52d2eaeb21ab1e3ec9160fd50
parentb014c81fa73c3ac613835a650da441ab06e8c6ee (diff)
[1.2.X] Changed ModelForm.fields and ModelForm.exclude examples to use tuples instead of lists since they were used inconsistently throughout the page (it wasn't hurting anything, but consistency is nice). Thanks to lspcity for the report and gruszczy for the patch.
Backport of [14134] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14135 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/topics/forms/modelforms.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index 2cdd2bfa74..203639db77 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -387,7 +387,7 @@ widget::
class AuthorForm(ModelForm):
class Meta:
model = Author
- fields = ['name', 'title', 'birth_date']
+ fields = ('name', 'title', 'birth_date')
widgets = {
'name': Textarea(attrs={'cols': 80, 'rows': 20}),
}
@@ -471,7 +471,7 @@ to be rendered first, we could specify the following ``ModelForm``::
>>> class BookForm(ModelForm):
... class Meta:
... model = Book
- ... fields = ['title', 'author']
+ ... fields = ('title', 'author')
.. _overriding-modelform-clean-method:
@@ -514,7 +514,7 @@ the ``Meta.fields`` or ``Meta.excludes`` lists::
>>> class RestrictedArticleForm(EnhancedArticleForm):
... class Meta(ArticleForm.Meta):
- ... exclude = ['body']
+ ... exclude = ('body',)
This adds the extra method from the ``EnhancedArticleForm`` and modifies
the original ``ArticleForm.Meta`` to remove one field.