Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #9420 -- Fixed an exception type in the documentation of Querys…

…et.get().

Based on a suggestion from daveyjoe.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 032b7bc45e606767bdb129be52eb5cccc716d907 1 parent 9900c87
@malcolmt malcolmt authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 docs/ref/models/querysets.txt
View
10 docs/ref/models/querysets.txt
@@ -743,11 +743,13 @@ they query the database each time they're called.
Returns the object matching the given lookup parameters, which should be in
the format described in `Field lookups`_.
-``get()`` raises ``AssertionError`` if more than one object was found.
+``get()`` raises ``MultipleObjectsReturned`` if more than one object was
+found. The ``MultipleObjectsReturned`` exception is an attribute of the model
+class.
-``get()`` raises a ``DoesNotExist`` exception if an object wasn't found for the
-given parameters. The ``DoesNotExist`` exception is an attribute of the model
-class. Example::
+``get()`` raises a ``DoesNotExist`` exception if an object wasn't found for
+the given parameters. This exception is also an attribute of the model class.
+Example::
Entry.objects.get(id='foo') # raises Entry.DoesNotExist

0 comments on commit 032b7bc

Please sign in to comment.
Something went wrong with that request. Please try again.