Added basic querying - find and find_one

This commit is contained in:
Harry Marr 2009-11-19 01:09:58 +00:00
commit 8ec6fecd23
7 changed files with 141 additions and 12 deletions

View file

@ -14,4 +14,7 @@ class Document(BaseDocument):
__metaclass__ = TopLevelDocumentMetaclass
def save(self):
self.collection._save_document(self._to_mongo())
"""Save the document to the database. If the document already exists,
it will be updated, otherwise it will be created.
"""
self.objects._save_document(self)