mongoengine/mongomap/document.py
2009-11-19 01:09:58 +00:00

21 lines
494 B
Python

from base import DocumentMetaclass, TopLevelDocumentMetaclass, BaseDocument
__all__ = ['Document', 'EmbeddedDocument']
class EmbeddedDocument(BaseDocument):
__metaclass__ = DocumentMetaclass
class Document(BaseDocument):
__metaclass__ = TopLevelDocumentMetaclass
def save(self):
"""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)