Fixed hashing of EmbeddedDocuments (#348)

This commit is contained in:
Ross Lawley
2013-06-05 11:31:13 +00:00
parent ce44843e27
commit a246154961
3 changed files with 10 additions and 1 deletions

View File

@@ -215,7 +215,7 @@ class BaseDocument(object):
return not self.__eq__(other)
def __hash__(self):
if self.pk is None:
if getattr(self, 'pk', None) is None:
# For new object
return super(BaseDocument, self).__hash__()
else: