OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, collection, id, database=None, _extra={}, **kwargs) |
def | collection (self) |
def | id (self) |
def | database (self) |
def | __getattr__ (self, key) |
def | __setstate__ (self, state) |
def | as_doc (self) |
def | __repr__ (self) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
def | __deepcopy__ (self, memo) |
A reference to a document stored in MongoDB.
def __init__ | ( | self, | |
collection, | |||
id, | |||
database = None , |
|||
_extra = {} , |
|||
** | kwargs | ||
) |
Initialize a new :class:`DBRef`. Raises :class:`TypeError` if `collection` or `database` is not an instance of :class:`basestring` (:class:`str` in python 3). `database` is optional and allows references to documents to work across databases. Any additional keyword arguments will create additional fields in the resultant embedded document. :Parameters: - `collection`: name of the collection the document is stored in - `id`: the value of the document's ``"_id"`` field - `database` (optional): name of the database to reference - `**kwargs` (optional): additional keyword arguments will create additional, custom fields .. mongodoc:: dbrefs
def __deepcopy__ | ( | self, | |
memo | |||
) |
Support function for `copy.deepcopy()`.
def __eq__ | ( | self, | |
other | |||
) |
def __getattr__ | ( | self, | |
key | |||
) |
def __hash__ | ( | self | ) |
Get a hash value for this :class:`DBRef`.
def __ne__ | ( | self, | |
other | |||
) |
def __repr__ | ( | self | ) |
def __setstate__ | ( | self, | |
state | |||
) |
def as_doc | ( | self | ) |
Get the SON document representation of this DBRef. Generally not needed by application developers
def collection | ( | self | ) |
Get the name of this DBRef's collection as unicode.
def database | ( | self | ) |
Get the name of this DBRef's database. Returns None if this DBRef doesn't specify a database.
def id | ( | self | ) |
Get this DBRef's _id.