Change so typeclass equality is not only based on dbid but also on model.

This commit is contained in:
Griatch 2016-10-12 23:28:56 +02:00
parent 1981f8073f
commit 196f1ad270

View file

@ -339,7 +339,10 @@ class TypedObject(SharedMemoryModel):
#
def __eq__(self, other):
return other and hasattr(other, 'dbid') and self.dbid == other.dbid
try:
return self.__dbclass__ == other.__dbclass__ and self.dbid == other.dbid
except AttributeError:
return False
def __str__(self):
return smart_str("%s" % self.db_key)