Query values may be processed before being used

This commit is contained in:
Harry Marr
2010-01-06 03:14:21 +00:00
parent 196f4471be
commit 557fb19d13
6 changed files with 72 additions and 11 deletions

View File

@@ -67,8 +67,9 @@ class Document(BaseDocument):
def reload(self):
"""Reloads all attributes from the database.
"""
object_id = self._fields['id'].to_mongo(self.id)
obj = self.__class__.objects(id=object_id).first()
#object_id = self._fields['id'].to_mongo(self.id)
#obj = self.__class__.objects(id=object_id).first()
obj = self.__class__.objects(id=self.id).first()
for field in self._fields:
setattr(self, field, getattr(obj, field))