Added queryset_manager decorator

This commit is contained in:
Harry Marr
2009-12-23 19:32:00 +00:00
parent 69eaf4b3f6
commit 3d70b65a45
7 changed files with 62 additions and 15 deletions

View File

@@ -44,8 +44,8 @@ class Document(BaseDocument):
document already exists, it will be updated, otherwise it will be
created.
"""
object_id = self.objects._collection.save(self.to_mongo())
self.id = object_id
object_id = self.__class__.objects._collection.save(self.to_mongo())
self.id = self._fields['id'].to_python(object_id)
def delete(self):
"""Delete the :class:`~mongoengine.Document` from the database. This