Added sort method to QuerySet

This commit is contained in:
Harry Marr
2009-12-18 18:41:44 +00:00
parent 44fc9096a4
commit 5e6a6aa886
3 changed files with 37 additions and 1 deletions

View File

@@ -25,7 +25,8 @@ class Document(BaseDocument):
"""Delete the document from the database. This will only take effect
if the document has been previously saved.
"""
self.objects._collection.remove(self.id)
object_id = self._fields['id'].to_mongo(self.id)
self.__class__.objects(_id=object_id).delete()
@classmethod
def drop_collection(cls):