Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #9420 -- Fixed an exception type in the documentation of

Queryset.get().  Based on a suggestion from daveyjoe.

Backport of r9257 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8cf2a05d35a3f2a296393b8eb83f7db272bf3ad8 1 parent 568cb5d
Malcolm Tredinnick authored October 24, 2008

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. 10  docs/ref/models/querysets.txt
10  docs/ref/models/querysets.txt
@@ -743,11 +743,13 @@ they query the database each time they're called.
743 743
 Returns the object matching the given lookup parameters, which should be in
744 744
 the format described in `Field lookups`_.
745 745
 
746  
-``get()`` raises ``AssertionError`` if more than one object was found.
  746
+``get()`` raises ``MultipleObjectsReturned`` if more than one object was
  747
+found. The ``MultipleObjectsReturned`` exception is an attribute of the model
  748
+class.
747 749
 
748  
-``get()`` raises a ``DoesNotExist`` exception if an object wasn't found for the
749  
-given parameters. The ``DoesNotExist`` exception is an attribute of the model
750  
-class. Example::
  750
+``get()`` raises a ``DoesNotExist`` exception if an object wasn't found for
  751
+the given parameters. This exception is also an attribute of the model class.
  752
+Example::
751 753
 
752 754
     Entry.objects.get(id='foo') # raises Entry.DoesNotExist
753 755
 

0 notes on commit 8cf2a05

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