updated documentation
This commit is contained in:
parent
8f4a579df9
commit
fbcf58c48f
@ -15,7 +15,6 @@ REPR_OUTPUT_SIZE = 20
|
|||||||
class DoesNotExist(Exception):
|
class DoesNotExist(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class MultipleObjectsReturned(Exception):
|
class MultipleObjectsReturned(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -27,6 +26,8 @@ class InvalidQueryError(Exception):
|
|||||||
class OperationError(Exception):
|
class OperationError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class InvalidCollectionError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
RE_TYPE = type(re.compile(''))
|
RE_TYPE = type(re.compile(''))
|
||||||
|
|
||||||
@ -341,8 +342,9 @@ class QuerySet(object):
|
|||||||
def get(self, *q_objs, **query):
|
def get(self, *q_objs, **query):
|
||||||
"""Retrieve the the matching object raising
|
"""Retrieve the the matching object raising
|
||||||
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
|
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
|
||||||
:class:`~mongoengine.queryset.DoesNotExist` exceptions if multiple or
|
`DocumentName.MultipleObjectsReturned` exception if multiple results and
|
||||||
no results are found.
|
:class:`~mongoengine.queryset.DoesNotExist` or `DocumentName.DoesNotExist`
|
||||||
|
if no results are found.
|
||||||
|
|
||||||
.. versionadded:: 0.3
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
@ -359,10 +361,11 @@ class QuerySet(object):
|
|||||||
|
|
||||||
def get_or_create(self, *q_objs, **query):
|
def get_or_create(self, *q_objs, **query):
|
||||||
"""Retreive unique object or create, if it doesn't exist. Raises
|
"""Retreive unique object or create, if it doesn't exist. Raises
|
||||||
:class:`~mongoengine.queryset.MultipleObjectsReturned` if multiple
|
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
|
||||||
results are found. A new document will be created if the document
|
`DocumentName.MultipleObjectsReturned` if multiple results are found.
|
||||||
doesn't exists; a dictionary of default values for the new document
|
A new document will be created if the document doesn't exists; a
|
||||||
may be provided as a keyword argument called :attr:`defaults`.
|
dictionary of default values for the new document may be provided as a
|
||||||
|
keyword argument called :attr:`defaults`.
|
||||||
|
|
||||||
.. versionadded:: 0.3
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
@ -870,10 +873,6 @@ class QuerySet(object):
|
|||||||
return repr(data)
|
return repr(data)
|
||||||
|
|
||||||
|
|
||||||
class InvalidCollectionError(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class QuerySetManager(object):
|
class QuerySetManager(object):
|
||||||
|
|
||||||
def __init__(self, manager_func=None):
|
def __init__(self, manager_func=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user