From aa5a9ff1f428027a5eb6adec54fa6f596ae4e32d Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Wed, 21 Nov 2012 17:03:32 +0000 Subject: [PATCH] Documentation update for document errors (MongoEngine/mongoengine#124) --- docs/changelog.rst | 1 + docs/guide/querying.rst | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index c3c6340f..a13a5f1d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Changes in 0.8 ============== +- Documentation update for document errors (MongoEngine/mongoengine#124) - Deprecated `get_or_create` (MongoEngine/mongoengine#35) - Updated inheritable objects created by upsert now contain _cls (MongoEngine/mongoengine#118) - Added support for creating documents with embedded documents in a single operation (MongoEngine/mongoengine#6) diff --git a/docs/guide/querying.rst b/docs/guide/querying.rst index 14498017..d5829432 100644 --- a/docs/guide/querying.rst +++ b/docs/guide/querying.rst @@ -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