@@ -45,13 +45,20 @@ class BaseDocument(object):
4545
4646 def __init__ (self , * args , ** values ):
4747 """
48- Initialise a document or embedded document
49-
50- :param __auto_convert: Try and will cast python objects to Object types
51- :param values: A dictionary of values for the document
48+ Initialise a document or an embedded document.
49+
50+ :param values: A dictionary of keys and values for the document.
51+ It may contain additional reserved keywords, e.g. "__auto_convert".
52+ :param __auto_convert: If True, supplied values will be converted
53+ to Python-type values via each field's `to_python` method.
54+ :param __only_fields: A list of fields that have been loaded for this
55+ document. Empty if all fields have been loaded.
56+ :param _created: Indicates whether this is a brand new document or
57+ whether it's already been persisted before. Defaults to true.
5258 """
5359 self ._initialised = False
5460 self ._created = True
61+
5562 if args :
5663 # Combine positional arguments with named arguments.
5764 # We only want named arguments.
@@ -135,6 +142,7 @@ def __init__(self, *args, **values):
135142 # Flag initialised
136143 self ._initialised = True
137144 self ._created = _created
145+
138146 signals .post_init .send (self .__class__ , document = self )
139147
140148 def __delattr__ (self , * args , ** kwargs ):
0 commit comments