Documentation update for document errors (MongoEngine/mongoengine#124)

This commit is contained in:
Ross Lawley
2012-11-21 17:03:32 +00:00
parent 28ef54986d
commit aa5a9ff1f4
2 changed files with 6 additions and 3 deletions

View File

@@ -179,9 +179,11 @@ Retrieving unique results
-------------------------
To retrieve a result that should be unique in the collection, use
:meth:`~mongoengine.queryset.QuerySet.get`. This will raise
:class:`~mongoengine.queryset.DoesNotExist` if no document matches the query,
and :class:`~mongoengine.queryset.MultipleObjectsReturned` if more than one
document matched the query.
:class:`~mongoengine.queryset.DoesNotExist` if
no document matches the query, and
:class:`~mongoengine.queryset.MultipleObjectsReturned`
if more than one document matched the query. These exceptions are merged into
your document defintions eg: `MyDoc.DoesNotExist`
A variation of this method exists,
:meth:`~mongoengine.queryset.Queryset.get_or_create`, that will create a new