summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTianyi Wang <wty52133@gmail.com>2013-10-15 14:34:11 +0100
committerTim Graham <timograham@gmail.com>2013-10-15 09:58:57 -0400
commit312ca5e9cb89af790fa8af04811a3e4c5e621758 (patch)
tree7aabaa5c48f61611788151ea5d1070401c03164d /docs
parent1acd5fc9d293ac07adbb38d11c415dbadd431353 (diff)
[1.5.x] Improvement on InlineFormSet doc, refs #21006
Backport of 944a2bb7c1 from master
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/forms/modelforms.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index 7697441a96..b032366fd0 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -786,7 +786,7 @@ class's ``clean`` method::
class MyModelFormSet(BaseModelFormSet):
def clean(self):
super(MyModelFormSet, self).clean()
- # example custom validation across forms in the formset:
+ # example custom validation across forms in the formset
for form in self.forms:
# your custom formset validation
...
@@ -917,14 +917,14 @@ When overriding methods on ``InlineFormSet``, you should subclass
:class:`~models.BaseInlineFormSet` rather than
:class:`~models.BaseModelFormSet`.
-For example, If you want to override ``clean()``::
+For example, if you want to override ``clean()``::
from django.forms.models import BaseInlineFormSet
- class MyModelFormSet(BaseInlineFormSet):
+ class CustomInlineFormSet(BaseInlineFormSet):
def clean(self):
- super(MyModelFormSet, self).clean()
- # example custom validation across forms in the formset:
+ super(CustomInlineFormSet, self).clean()
+ # example custom validation across forms in the formset
for form in self.forms:
# your custom formset validation
...
@@ -935,7 +935,7 @@ Then when you create your inline formset, pass in the optional argument
``formset``::
>>> from django.forms.models import inlineformset_factory
- >>> BookFormSet = inlineformset_factory(Author, Book, formset=MyModelFormSet)
+ >>> BookFormSet = inlineformset_factory(Author, Book, formset=CustomInlineFormSet)
>>> author = Author.objects.get(name=u'Mike Royko')
>>> formset = BookFormSet(instance=author)