mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #26020 -- Normalized header stylings in docs.
This commit is contained in:
parent
79d0a4fdb0
commit
bca9faae95
132 changed files with 1498 additions and 1464 deletions
|
@ -210,7 +210,7 @@ Validation on a ``ModelForm``
|
|||
|
||||
There are two main steps involved in validating a ``ModelForm``:
|
||||
|
||||
1. :ref:`Validating the form <form-and-field-validation>`
|
||||
1. :doc:`Validating the form </ref/forms/validation>`
|
||||
2. :ref:`Validating the model instance <validating-objects>`
|
||||
|
||||
Just like normal form validation, model form validation is triggered implicitly
|
||||
|
@ -234,7 +234,7 @@ validation step, right after the form's ``clean()`` method is called.
|
|||
.. _overriding-modelform-clean-method:
|
||||
|
||||
Overriding the clean() method
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can override the ``clean()`` method on a model form to provide additional
|
||||
validation in the same way you can on a normal form.
|
||||
|
@ -253,7 +253,7 @@ attribute that gives its methods access to that specific model instance.
|
|||
validation, you must call the parent class's ``clean()`` method.
|
||||
|
||||
Interaction with model validation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
As part of the validation process, ``ModelForm`` will call the ``clean()``
|
||||
method of each field on your model that has a corresponding field on your form.
|
||||
|
@ -268,7 +268,7 @@ on the model's ``clean()`` hook.
|
|||
.. _considerations-regarding-model-errormessages:
|
||||
|
||||
Considerations regarding model's ``error_messages``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Error messages defined at the
|
||||
:attr:`form field <django.forms.Field.error_messages>` level or at the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue