diff options
| author | David Krisch <david@hq.realgeeks.com> | 2015-05-07 15:30:04 -1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-08 13:13:45 -0400 |
| commit | 51ebc8805e1a0bd5d347587f483fc07fc206df9f (patch) | |
| tree | 895b2a2445fd3b595ea0c9d4f96d1cc43c3f5807 /docs/ref/models/querysets.txt | |
| parent | eb534f64121a38ba0951a6fa3d9ee85aac33213c (diff) | |
[1.8.x] Fixed #24763 -- Moved DoesNotExist exception to model docs.
Backport of 1a62f197078eae72eba85f23aabacc06ad4c7d79 from master
Diffstat (limited to 'docs/ref/models/querysets.txt')
| -rw-r--r-- | docs/ref/models/querysets.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index e6e2335040..673037ec31 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1578,15 +1578,15 @@ than one object was found. The :exc:`~django.core.exceptions.MultipleObjectsReturned` exception is an attribute of the model class. -``get()`` raises a :exc:`~django.core.exceptions.DoesNotExist` exception if an -object wasn't found for the given parameters. This exception is also an -attribute of the model class. Example:: +``get()`` raises a :exc:`~django.db.models.Model.DoesNotExist` exception if an +object wasn't found for the given parameters. This exception is an attribute +of the model class. Example:: Entry.objects.get(id='foo') # raises Entry.DoesNotExist -The :exc:`~django.core.exceptions.DoesNotExist` exception inherits from +The :exc:`~django.db.models.Model.DoesNotExist` exception inherits from :exc:`django.core.exceptions.ObjectDoesNotExist`, so you can target multiple -:exc:`~django.core.exceptions.DoesNotExist` exceptions. Example:: +:exc:`~django.db.models.Model.DoesNotExist` exceptions. Example:: from django.core.exceptions import ObjectDoesNotExist try: @@ -1905,7 +1905,7 @@ If your model's :ref:`Meta <meta-options>` specifies field specified in :attr:`~django.db.models.Options.get_latest_by` by default. Like :meth:`get()`, ``earliest()`` and ``latest()`` raise -:exc:`~django.core.exceptions.DoesNotExist` if there is no object with the +:exc:`~django.db.models.Model.DoesNotExist` if there is no object with the given parameters. Note that ``earliest()`` and ``latest()`` exist purely for convenience and |
