summaryrefslogtreecommitdiff
path: root/docs/topics/forms/modelforms.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics/forms/modelforms.txt')
-rw-r--r--docs/topics/forms/modelforms.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index d161b3f7f5..fe1e053d50 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -338,6 +338,16 @@ parameter when declaring the form field::
... class Meta:
... model = Article
+Overriding the clean() method
+-----------------------------
+
+You can overide the ``clean()`` method on a model form to provide additional
+validation in the same way you can on a normal form. However, by default the
+``clean()`` method validates the uniqueness of fields that are marked as unique
+on the model, and those marked as unque_together, if you would like to overide
+the ``clean()`` method and maintain the default validation you must call the
+parent class's ``clean()`` method.
+
Form inheritance
----------------
@@ -500,4 +510,4 @@ books of a specific author. Here is how you could accomplish this::
>>> from django.forms.models import inlineformset_factory
>>> BookFormSet = inlineformset_factory(Author, Book)
>>> author = Author.objects.get(name=u'Orson Scott Card')
- >>> formset = BookFormSet(instance=author) \ No newline at end of file
+ >>> formset = BookFormSet(instance=author)