| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
Document
Base class for all models. Classes inheritiing this one should include instances of the BaseField. This class implements reasonable defaults for each method, but these can be overriden by subclasses
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
_id = None
|
|||
|
|||
|
Inherited from |
|||
|
|||
By default, stores everything from kwargs into self as an attribute with the same name
|
A class method that returns the MongoDB collection that instances of the class will be stored in. By default, the collection name is the lowercased classname |
By default, prints the string representation of self.to_dict()
|
Converts the model into a dictionary suitable for passing into MongoDB. By default, it dumps all attributes not prefixed with '_' into the dictionary. |
Saves the model in MongoDB. By default, it simply writes the results of to_dict() into the database. If the field self._id is None, it performs and insert and sets self._id to the id of the newly inserted entry. If self._id is already set, it updates the existing field |
Finds an instance of a document by its unique id. oid can either be an ObjectId or its string representation |
Finds the first instance of cls matching query in the database and returns it. Information about the query argument can be found in the PyMongo documentation for the Collection class. |
Finds instances of cls in the database. Information about query, sort, and limit can be found in the PyMongo documentation for the Collection class. |
Calls ensure_index on the MongoDB collection associated with this class. Read the PyMongo documentation for more information. |
x.__setattr__('name', value) <==> x.name = value
|
x.__getattribute__('name') <==> x.name
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri May 20 23:31:51 2011 | http://epydoc.sourceforge.net |