Added queryset_manager decorator
This commit is contained in:
parent
69eaf4b3f6
commit
3d70b65a45
7 changed files with 62 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue