diff options
Diffstat (limited to 'docs/ref/models/class.txt')
-rw-r--r-- | docs/ref/models/class.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/models/class.txt b/docs/ref/models/class.txt index c41052788e..81414973a9 100644 --- a/docs/ref/models/class.txt +++ b/docs/ref/models/class.txt @@ -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`` ----------- |