From a9ad0818996f2c307f505dca68008841be06e0fc Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 18 Apr 2014 15:00:26 -0400 Subject: [PATCH] [1.7.x] Fixed #22473 -- Emphasized that Model.clean() is not called from Model.save(). Backport of b43bbd6d39 from master --- docs/ref/models/instances.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 21bcba4636..7b11658729 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, :data:`~django.core.exceptions.NON_FIELD_ERRORS`, that is used for errors