Ticket #6842: r8472.diff

File r8472.diff, 1.7 KB (added by John Shimek, 16 years ago)
  • docs/exceptions.txt

     
     1=================
     2Django Exceptions
     3=================
     4
     5This document describes the exceptions thrown by Django.
     6
     7Django uses many standard Python exceptions as well as some Django specific
     8exceptions.
     9
     10Django Specific Exceptions
     11==========================
     12
     13Most of the Django specific exceptions are in the ``django.core.exceptions`` module.  For example, ``django.core.exceptions.ViewDoesNotExist``.
     14
     15ObjectDoesNotExist and DoesNotExist
     16-----------------------------------
     17The ``DoesNotExist`` exception is raised when an object is not for the given parameters of a query.  The ``DoesNotExist`` exception is not in ``django.core.exceptions``.  Instead, it is an attribute of the model class and inherits from ``ObjectDoesNotExist`` which is in ``django.core.exceptions``.  See `get`_ for further information on ``ObjectDoesNotExist`` and ``DoesNotExist``.
     18
     19.. _`get`: ../db-api/#get-kwargs
     20
     21MultipleObjectsReturned
     22-----------------------
     23The ``MultipleObjectsReturned`` exception is raised by a query if only one object is expected, but multiple objects are returned.  See `get`_ for further information.  The ``MultipleObjectsReturned`` exception is an attribute of a model class and it is in ``django.core.exceptions``.
     24
     25.. _`get`: ../db-api/#get-kwargs
     26
     27SuspiciousOperation
     28-------------------
     29
     30PermissionDenied
     31----------------
     32
     33ViewDoesNotExist
     34----------------
     35
     36MiddlewareNotUsed
     37-----------------
     38
     39ImproperlyConfigured
     40--------------------
     41
     42FieldError
     43----------
Back to Top