summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-04-18 15:00:26 -0400
committerTim Graham <timograham@gmail.com>2014-04-18 15:03:30 -0400
commit839deb7a77a2321309da944031b7316322a0afbb (patch)
tree78999bb6a4ba152d647db50573a418d3a75512fa /docs/ref
parent9e28bfb3240b6fc11384139616a9024db835ccda (diff)
[1.6.x] Fixed #22473 -- Emphasized that Model.clean() is not called from Model.save().
Backport of b43bbd6d39 from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/instances.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index d5863ec529..4a2c11225e 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -149,6 +149,9 @@ access to more than a single field::
if self.status == 'published' and self.pub_date is None:
self.pub_date = datetime.date.today()
+Note, however, that like :meth:`Model.full_clean()`, a model's ``clean()``
+method is not invoked when you call your model's :meth:`~Model.save()` method.
+
Any :exc:`~django.core.exceptions.ValidationError` exceptions raised by
``Model.clean()`` will be stored in a special key error dictionary key,
``NON_FIELD_ERRORS``, that is used for errors that are tied to the entire model