summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@sixmedia.com>2013-06-05 14:55:05 -0400
committerTim Graham <timograham@gmail.com>2013-06-18 08:01:17 -0400
commitee77d4b25360a9fc050c32769a334fd69a011a63 (patch)
tree1f20a040970dc53d2e4977d79fe66ea7626cd932 /docs/ref/models
parentf34cfec0fa1243b4a3b9865b961a2360f211f0d8 (diff)
Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/instances.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index f989ff1bec..cfc95db092 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -84,12 +84,18 @@ need to call a model's :meth:`~Model.full_clean()` method if you plan to handle
validation errors yourself, or if you have excluded fields from the
:class:`~django.forms.ModelForm` that require validation.
-.. method:: Model.full_clean(exclude=None)
+.. method:: Model.full_clean(exclude=None, validate_unique=True)
+
+.. versionchanged:: 1.6
+
+ The ``validate_unique`` parameter was added to allow skipping
+ :meth:`Model.validate_unique()`. Previously, :meth:`Model.validate_unique()`
+ was always called by ``full_clean``.
This method calls :meth:`Model.clean_fields()`, :meth:`Model.clean()`, and
-:meth:`Model.validate_unique()`, in that order and raises a
-:exc:`~django.core.exceptions.ValidationError` that has a ``message_dict``
-attribute containing errors from all three stages.
+:meth:`Model.validate_unique()` (if ``validate_unique`` is ``True``, in that
+order and raises a :exc:`~django.core.exceptions.ValidationError` that has a
+``message_dict`` attribute containing errors from all three stages.
The optional ``exclude`` argument can be used to provide a list of field names
that can be excluded from validation and cleaning.