Merge pull request #1502 from marfire/doc_modelvalid

Documentation -- Corrected error about Model.full_clean()
This commit is contained in:
Tim Graham 2013-08-21 14:45:44 -07:00
commit c5f768f8cc
1 changed files with 3 additions and 8 deletions

View File

@ -104,14 +104,9 @@ aren't present on your form from being validated since any errors raised could
not be corrected by the user. not be corrected by the user.
Note that ``full_clean()`` will *not* be called automatically when you call Note that ``full_clean()`` will *not* be called automatically when you call
your model's :meth:`~Model.save()` method, nor as a result of your model's :meth:`~Model.save()` method. You'll need to call it manually
:class:`~django.forms.ModelForm` validation. In the case of when you want to run one-step model validation for your own manually created
:class:`~django.forms.ModelForm` validation, :meth:`Model.clean_fields()`, models. For example::
:meth:`Model.clean()`, and :meth:`Model.validate_unique()` are all called
individually.
You'll need to call ``full_clean`` manually when you want to run one-step model
validation for your own manually created models. For example::
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
try: try: