Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14545 -- Added ValidationError to Exceptions Reference docs an…

…d improved Sphinx metadata.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e18f8b1d22402dc9e55263360f8875e16af1ab64 1 parent b874549
authored October 23, 2010

Showing 1 changed file with 61 additions and 42 deletions. Show diff stats Hide diff stats

  1. 103  docs/ref/exceptions.txt
103  docs/ref/exceptions.txt
@@ -14,84 +14,103 @@ Django-specific Exceptions
14 14
 
15 15
 ObjectDoesNotExist and DoesNotExist
16 16
 -----------------------------------
  17
+.. exception:: DoesNotExist
  18
+.. exception:: ObjectDoesNotExist
17 19
 
18  
-The ``DoesNotExist`` exception is raised when an object is not found
19  
-for the given parameters of a query.
  20
+    The :exc:`DoesNotExist` exception is raised when an object is not found
  21
+    for the given parameters of a query.
20 22
 
21  
-``ObjectDoesNotExist`` is defined in ``django.core.exceptions``.
22  
-``DoesNotExist`` is a subclass of the base ``ObjectDoesNotExist``
23  
-exception that is provided on every model class as a way of
24  
-identifying the specific type of object that could not be found.
  23
+    :exc:`ObjectDoesNotExist` is defined in :mod:`django.core.exceptions`.
  24
+    :exc:`DoesNotExist` is a subclass of the base :exc:`ObjectDoesNotExist`
  25
+    exception that is provided on every model class as a way of
  26
+    identifying the specific type of object that could not be found.
25 27
 
26  
-See :meth:`~django.db.models.QuerySet.get()` for further information
27  
-on ``ObjectDoesNotExist`` and ``DoesNotExist``.
  28
+    See :meth:`~django.db.models.QuerySet.get()` for further information
  29
+    on :exc:`ObjectDoesNotExist` and :exc:`DoesNotExist`.
28 30
 
29 31
 MultipleObjectsReturned
30 32
 -----------------------
  33
+.. exception:: MultipleObjectsReturned
31 34
 
32  
-The ``MultipleObjectsReturned`` exception is raised by a query if only
33  
-one object is expected, but multiple objects are returned. A base version
34  
-of this exception is provided in ``django.core.exceptions``; each model
35  
-class contains a subclassed version that can be used to identify the
36  
-specific object type that has returned multiple objects.
  35
+    The :exc:`MultipleObjectsReturned` exception is raised by a query if only
  36
+    one object is expected, but multiple objects are returned. A base version
  37
+    of this exception is provided in :mod:`django.core.exceptions`; each model
  38
+    class contains a subclassed version that can be used to identify the
  39
+    specific object type that has returned multiple objects.
37 40
 
38  
-See :meth:`~django.db.models.QuerySet.get()` for further information.
  41
+    See :meth:`~django.db.models.QuerySet.get()` for further information.
39 42
 
40 43
 SuspiciousOperation
41 44
 -------------------
  45
+.. exception:: SuspiciousOperation
42 46
 
43  
-The ``SuspiciousOperation`` exception is raised when a user has performed
44  
-an operation that should be considered suspicious from a security perspective,
45  
-such as tampering with a session cookie.
  47
+    The :exc:`SuspiciousOperation` exception is raised when a user has performed
  48
+    an operation that should be considered suspicious from a security perspective,
  49
+    such as tampering with a session cookie.
46 50
 
47 51
 PermissionDenied
48 52
 ----------------
  53
+.. exception:: PermissionDenied
49 54
 
50  
-The ``PermissionDenied`` exception is raised when a user does not have
51  
-permission to perform the action requested.
  55
+    The :exc:`PermissionDenied` exception is raised when a user does not have
  56
+    permission to perform the action requested.
52 57
 
53 58
 ViewDoesNotExist
54 59
 ----------------
  60
+.. exception:: ViewDoesNotExist
55 61
 
56  
-The ``ViewDoesNotExist`` exception is raised by
57  
-``django.core.urlresolvers`` when a requested view does not exist.
  62
+    The :exc:`ViewDoesNotExist` exception is raised by
  63
+    :mod:`django.core.urlresolvers` when a requested view does not exist.
58 64
 
59 65
 MiddlewareNotUsed
60 66
 -----------------
  67
+.. exception:: MiddlewareNotUsed
61 68
 
62  
-The ``MiddlewareNotUsed`` exception is raised when a middleware is not
63  
-used in the server configuration.
  69
+    The :exc:`MiddlewareNotUsed` exception is raised when a middleware is not
  70
+    used in the server configuration.
64 71
 
65 72
 ImproperlyConfigured
66 73
 --------------------
  74
+.. exception:: ImproperlyConfigured
67 75
 
68  
-The ``ImproperlyConfigured`` exception is raised when Django is
69  
-somehow improperly configured -- for example, if a value in ``settings.py``
70  
-is incorrect or unparseable.
  76
+    The :exc:`ImproperlyConfigured` exception is raised when Django is
  77
+    somehow improperly configured -- for example, if a value in ``settings.py``
  78
+    is incorrect or unparseable.
71 79
 
72 80
 FieldError
73 81
 ----------
74  
-
75  
-The ``FieldError`` exception is raised when there is a problem with a
76  
-model field. This can happen for several reasons:
77  
-
78  
-    - A field in a model clashes with a field of the same name from an
79  
-      abstract base class
80  
-    - An infinite loop is caused by ordering
81  
-    - A keyword cannot be parsed from the filter parameters
82  
-    - If a field cannot be determined from a keyword in the query
83  
-      parameters
84  
-    - If a join is not permitted on the specified field
85  
-    - If a field name is invalid
86  
-    - If a query contains invalid order_by arguments
  82
+.. exception:: FieldError
  83
+
  84
+    The :exc:`FieldError` exception is raised when there is a problem with a
  85
+    model field. This can happen for several reasons:
  86
+
  87
+        - A field in a model clashes with a field of the same name from an
  88
+          abstract base class
  89
+        - An infinite loop is caused by ordering
  90
+        - A keyword cannot be parsed from the filter parameters
  91
+        - A field cannot be determined from a keyword in the query
  92
+          parameters
  93
+        - A join is not permitted on the specified field
  94
+        - A field name is invalid
  95
+        - A query contains invalid order_by arguments
  96
+
  97
+ValidationError
  98
+---------------
  99
+.. exception:: ValidationError
  100
+
  101
+    The :exc:`ValidationError` exception is raised when data fails form or
  102
+    model field validation. For more information about validation, see
  103
+    :doc:`Form and Field Validation </ref/forms/validation>`,
  104
+    :ref:`Model Field Validation <validating-objects>` and the
  105
+    :doc:`Validator Reference </ref/validators>`.
87 106
 
88 107
 Database Exceptions
89 108
 ===================
90 109
 
91  
-Django wraps the standard database exceptions ``DatabaseError`` and
92  
-``IntegrityError`` so that your Django code has a guaranteed common
  110
+Django wraps the standard database exceptions :exc:`DatabaseError` and
  111
+:exc:`IntegrityError` so that your Django code has a guaranteed common
93 112
 implementation of these classes. These database exceptions are
94  
-provided in ``django.db``.
  113
+provided in :mod:`django.db`.
95 114
 
96 115
 The Django wrappers for database exceptions behave exactly the same as
97 116
 the underlying database exceptions. See `PEP 249 - Python Database API

0 notes on commit e18f8b1

Please sign in to comment.
Something went wrong with that request. Please try again.