mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Doc'd Model.MultipleObjectsReturned docs and improved documentation related with models exceptions.
This commit is contained in:
@@ -25,6 +25,20 @@ Attributes
|
||||
to catch exceptions for a particular model class. The exception is a
|
||||
subclass of :exc:`django.core.exceptions.ObjectDoesNotExist`.
|
||||
|
||||
``MultipleObjectsReturned``
|
||||
---------------------------
|
||||
|
||||
.. exception:: Model.MultipleObjectsReturned
|
||||
|
||||
This exception is raised by :meth:`.QuerySet.get` when multiple objects are
|
||||
found for the given lookups.
|
||||
|
||||
Django provides a ``MultipleObjectsReturned`` exception as an attribute of
|
||||
each model class to identify the class of object for which multiple objects
|
||||
were found, allowing you to catch exceptions for a particular model class.
|
||||
The exception is a subclass of
|
||||
:exc:`django.core.exceptions.MultipleObjectsReturned`.
|
||||
|
||||
``objects``
|
||||
-----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user