Ticket #13100: 12833.diff

File 12833.diff, 1.8 KB (added by ptone, 5 years ago)

durr - trac needs the diff extension to make it perty

  • docs/ref/models/instances.txt

     
    3434
    3535.. versionadded:: 1.2
    3636
    37 There are three steps in validating a model, and all three are called by a
    38 model's ``full_clean()`` method. Most of the time, this method will be called
    39 automatically by a ``ModelForm``. (See the :ref:`ModelForm documentation
    40 <topics-forms-modelforms>` for more information.) You should only need to call
    41 ``full_clean()`` if you plan to handle validation errors yourself.
     37There are three steps in validating a model:
    4238
     39    * Validate the model fields
     40    * Validate the model as a whole
     41    * Validate the field uniqueness
     42   
     43All three steps are performed by a model's ``full_clean()`` method.
     44Most of the time, each step is performed automatically via the is_valid method of ``ModelForm``. (See the :ref:`ModelForm documentation <topics-forms-modelforms>`
     45for more information.)
     46You should only need to call a model's ``full_clean()`` method if you plan to
     47handle validation errors yourself.
     48
    4349.. method:: Model.full_clean(exclude=None)
    4450
    4551This method calls ``Model.clean_fields()``, ``Model.clean()``, and
     
    5258validated since any errors raised could not be corrected by the user.
    5359
    5460Note that ``full_clean()`` will NOT be called automatically when you call
    55 your model's ``save()`` method. You'll need to call it manually if you want
    56 to run model validation outside of a ``ModelForm``. (This is for backwards
    57 compatibility.)
     61your model's ``save()`` method, nor through ``ModelForm`` validation.
     62You'll need to call it manually when you want to run model validation outside of a ``ModelForm``. (This is for backwards compatibility.)
    5863
    5964Example::
    6065
Back to Top