Change so typeclass equality is not only based on dbid but also on model.
This commit is contained in:
parent
1981f8073f
commit
196f1ad270
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue