Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made some edits to the validation part of docs/ref/models/instances.txt

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12124 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d8b7772fca793aa734df603d745a42a558b3bdc3 1 parent 50bfa46
@adrianholovaty adrianholovaty authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 docs/ref/models/instances.txt
View
23 docs/ref/models/instances.txt
@@ -34,31 +34,30 @@ Validating objects
.. versionadded:: 1.2
-To validate your model, just call its ``full_validate()`` method:
+To validate your model, call its ``full_validate()`` method:
.. method:: Model.full_validate([exclude=[]])
-The optional ``exclude`` argument can contain a list of field names that should
-be omitted when validating. This method raises ``ValidationError`` containing a
-message dict with errors from all fields.
+The optional ``exclude`` argument can contain a list of field names to omit
+when validating. This method raises ``ValidationError`` containing a
+message dictionary with errors from all fields.
To add your own validation logic, override the supplied ``validate()`` method:
Note that ``full_validate`` will NOT be called automatically when you call
-your model's ``save()`` method. You will need to call it manually if you wish
-to run your model validators. This is for the purposes of backwards
-compatibility. However, if you are using a ``ModelForm``, it will call
-``full_validate`` for you, and present any errors along with the other form
-error messages.
+your model's ``save()`` method. You'll need to call it manually if you want
+to run your model validators. (This is for backwards compatibility.) However,
+if you're using a ``ModelForm``, it will call ``full_validate`` for you and
+will present any errors along with the other form error messages.
.. method:: Model.validate()
The ``validate()`` method on ``Model`` by default checks for uniqueness of
-fields and group of fields that are declared to be unique so, remember to call
-``self.validate_unique()`` or the superclasses ``validate`` method if you want
+fields and group of fields that are declared to be unique, so remember to call
+``self.validate_unique()`` or the superclass' ``validate`` method if you want
this validation to run.
-Any ``ValidationError`` raised in this method will be propagated in the
+Any ``ValidationError`` raised in this method will be included in the
``message_dict`` under ``NON_FIELD_ERRORS``.
Saving objects
Please sign in to comment.
Something went wrong with that request. Please try again.