Ticket #6842: 6842.diff

File 6842.diff, 5.4 KB (added by Tim Graham, 14 years ago)

small improvements to existing patch

  • docs/index.txt

     
    152152      :ref:`Apache authentication <howto-apache-auth>` |
    153153      :ref:`Serving static files <howto-static-files>` |
    154154      :ref:`Tracking code errors by e-mail <howto-error-reporting>`
     155 
     156    * **Exceptions:**
     157      :ref:`Overview <ref-exceptions>`
    155158
    156159Other batteries included
    157160========================
  • docs/ref/models/querysets.txt

     
    884906These methods do not use a cache (see :ref:`caching-and-querysets`). Rather,
    885907they query the database each time they're called.
    886908
    887 .. _get-kwargs:
    888 
    889909``get(**kwargs)``
    890910~~~~~~~~~~~~~~~~~
    891911
     912.. method:: QuerySet.get(**kwargs)
     913
    892914Returns the object matching the given lookup parameters, which should be in
    893915the format described in `Field lookups`_.
    894916
  • docs/ref/exceptions.txt

     
     1.. _ref-exceptions:
     2
     3=================
     4Django Exceptions
     5=================
     6
     7This document describes the exceptions raised by Django.
     8
     9Django raises some Django specific exceptions as well as many standard Python
     10exceptions.
     11
     12Django Specific Exceptions
     13==========================
     14
     15.. module:: django.core.exceptions
     16    :synopsis: Django specific exceptions
     17
     18Most of the Django specific exceptions are in the ``django.core.exceptions``
     19module. For example, ``django.core.exceptions.ViewDoesNotExist``.
     20
     21ObjectDoesNotExist and DoesNotExist
     22-----------------------------------
     23The ``DoesNotExist`` exception is raised when an object is not found for the
     24given parameters of a query.  The ``DoesNotExist`` exception is not in ``django.core.exceptions``.  Instead, it is an attribute of the model class and
     25inherits from ``ObjectDoesNotExist`` which is in ``django.core.exceptions``.
     26See :meth:`~django.db.models.QuerySet.get()` for further information on
     27``ObjectDoesNotExist`` and ``DoesNotExist``.
     28
     29MultipleObjectsReturned
     30-----------------------
     31The ``MultipleObjectsReturned`` exception is raised by a query if only one
     32object is expected, but multiple objects are returned.  See
     33:meth:`~django.db.models.QuerySet.get()` for further information.  The ``MultipleObjectsReturned`` exception is an attribute of a
     34model class and it is in ``django.core.exceptions``.
     35
     36SuspiciousOperation
     37-------------------
     38The ``SuspiciousOperation`` exception is raised when a user did something
     39suspicious.
     40
     41PermissionDenied
     42----------------
     43The ``PermissionDenied`` exception is raised when a user does not have
     44permission to perform the action attempted.
     45
     46ViewDoesNotExist
     47----------------
     48The ``ViewDoesNotExist`` exception is raised by ``django.core.urlresolvers``
     49when a requested view does not exist.
     50
     51MiddlewareNotUsed
     52-----------------
     53The ``MiddlewareNotUsed`` exception is raised when a middleware is not used in
     54the server configuration.
     55
     56ImproperlyConfigured
     57--------------------
     58The ``ImproperlyConfigured`` exception is raised when Django is somehow
     59improperly configured.
     60
     61FieldError
     62----------
     63The ``FieldError`` exception is raised when there is a problem with a model
     64field.  This can happen for several reasons, some of which are:
     65   
     66    - A field in a model clashes with a field of the same name from an abstract base class
     67    - An infinite loop is caused by ordering
     68    - A keyword cannot be parsed from the filter parameters
     69    - If a field cannot be determined from a keyword in the query parameters
     70    - If a join is not permitted on the specified field
     71    - If a field name is invalid
     72    - If a query contains invalid order_by arguments
     73
     74Database Exceptions
     75===================
     76Django raises or propagates standard database exceptions, such as
     77``DatabaseError`` and ``IntegrityError``, when appropriate for operations on
     78model objects.  See  `PEP 249 - Python Database API Specification v2.0`_ for
     79further information about database exceptions.
     80
     81.. _`PEP 249 - Python Database API Specification v2.0`: http://www.python.org/dev/peps/pep-0249/
     82
     83Python Exceptions
     84=================
     85Django raises built-in Python exceptions when appropriate as well. See the
     86Python `documentation`_ for further information on the built-in exceptions.
     87
     88.. _`documentation`: http://docs.python.org/lib/module-exceptions.html
  • docs/ref/contrib/contenttypes.txt

    Property changes on: docs/ref/exceptions.txt
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
    114114
    115115    Takes a set of valid :ref:`lookup arguments <field-lookups-intro>` for the
    116116    model the :class:`~django.contrib.contenttypes.models.ContentType`
    117     represents, and does :ref:`a get() lookup <get-kwargs>` on that model,
    118     returning the corresponding object.
     117    represents, and does a :meth:`~django.db.models.QuerySet.get()` lookup on
     118    that model, returning the corresponding object.
    119119
    120120.. method:: models.ContentType.model_class()
    121121
Back to Top