Public Member Functions | |
def | __cmp__ |
def | __deepcopy__ |
def | __getattr__ |
def | __hash__ |
def | __init__ |
def | __repr__ |
def | as_doc |
def | collection |
def | database |
def | id |
Private Attributes | |
__collection | |
__database | |
__id | |
__kwargs |
A reference to a document stored in MongoDB.
Definition at line 21 of file bson/dbref.py.
def bson::dbref::DBRef::__cmp__ | ( | self, | ||
other | ||||
) |
Definition at line 104 of file bson/dbref.py.
def bson::dbref::DBRef::__deepcopy__ | ( | self, | ||
memo | ||||
) |
Support function for `copy.deepcopy()`. .. versionadded:: 1.10
Definition at line 120 of file bson/dbref.py.
def bson::dbref::DBRef::__getattr__ | ( | self, | ||
key | ||||
) |
Definition at line 81 of file bson/dbref.py.
def bson::dbref::DBRef::__hash__ | ( | self | ) |
Get a hash value for this :class:`DBRef`. .. versionadded:: 1.1
Definition at line 112 of file bson/dbref.py.
def bson::dbref::DBRef::__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`. `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 .. versionchanged:: 1.8 Now takes keyword arguments to specify additional fields. .. versionadded:: 1.1.1 The `database` parameter. .. mongodoc:: dbrefs
Definition at line 25 of file bson/dbref.py.
def bson::dbref::DBRef::__repr__ | ( | self | ) |
Definition at line 96 of file bson/dbref.py.
def bson::dbref::DBRef::as_doc | ( | self | ) |
Get the SON document representation of this DBRef. Generally not needed by application developers
Definition at line 84 of file bson/dbref.py.
def bson::dbref::DBRef::collection | ( | self | ) |
Get the name of this DBRef's collection as unicode.
Definition at line 60 of file bson/dbref.py.
def bson::dbref::DBRef::database | ( | self | ) |
Get the name of this DBRef's database. Returns None if this DBRef doesn't specify a database. .. versionadded:: 1.1.1
Definition at line 72 of file bson/dbref.py.
def bson::dbref::DBRef::id | ( | self | ) |
Get this DBRef's _id.
Definition at line 66 of file bson/dbref.py.
bson::dbref::DBRef::__collection [private] |
Definition at line 53 of file bson/dbref.py.
bson::dbref::DBRef::__database [private] |
Definition at line 55 of file bson/dbref.py.
bson::dbref::DBRef::__id [private] |
Definition at line 54 of file bson/dbref.py.
bson::dbref::DBRef::__kwargs [private] |
Definition at line 57 of file bson/dbref.py.