diff options
| author | Tim Graham <timograham@gmail.com> | 2014-04-18 15:00:26 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-04-18 15:00:26 -0400 |
| commit | b43bbd6d399c9ecca09c2e181715c8856ef5a598 (patch) | |
| tree | 641a4c87bf85fcd0a2533a44589b6e3c5101011e /docs | |
| parent | 275811a93c1e5bc6505605967cf2da01f1c038fe (diff) | |
Fixed #22473 -- Emphasized that Model.clean() is not called from Model.save().
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/instances.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 9bc7b841c7..1b7226b648 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -143,6 +143,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 |
