GenericReferenceField docs

This commit is contained in:
Harry Marr
2010-02-28 21:30:54 +00:00
parent 94e86a0be1
commit 81dd5adccf
3 changed files with 33 additions and 3 deletions

View File

@@ -398,7 +398,7 @@ class BaseDocument(object):
return obj
def __eq__(self, other):
assert hasattr(other, 'id'), "You cannot compare two objects of different type."
if self.id == other.id:
return True
if isinstance(other, self.__class__) and hasattr(other, 'id'):
if self.id == other.id:
return True
return False