Transforms the given function into an atomic operation. The function itself should be idempotent, that is repeatable without harm.
>>> class Foo(mongoengine.Document):
... @atomic
... def bar(self):
... # Do shit.
... return "stuff"
A mongoengine.Document that maps names to values which are mongoengine.Documents.
The key (a string).
The reference.
A log of a operation. This stores information about a method call on mongoengine.Documents.
A dictionary field that wraps a standard Python dictionary. This is similar to an embedded document, but the structure is not defined.
New in version 0.3.
A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.
Parameters: | op – The Operation instance. |
---|---|
Returns: | A OperationLog from the given Operation. |
Parameters: | args – The list of arguments passed to the function. |
---|---|
Returns: | A tuple of a list of ReferenceMappings and the other arguments. |
Parameters: | kwargs – A dict. |
---|---|
Returns: | A tuple of a list of ReferenceMappings and the other arguments. |
An field wrapper around MongoDB’s ObjectIds.
A reference to any Document subclass that will be automatically dereferenced on access (lazily).
New in version 0.3.
A dictionary field that wraps a standard Python dictionary. This is similar to an embedded document, but the structure is not defined.
New in version 0.3.
A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database.
A unicode string field.
Recovers the log.
Runs recovery on all interrupted operations.
A datetime field.
Returns: | The original list or arguments. |
---|
Returns: | The original dict of keyword arguments. |
---|