Fix models with respect to comparison with other value

This commit is contained in:
Thomas Adamcik 2010-04-28 21:52:05 +02:00
parent 64f81a6594
commit 3c36efad5d

View File

@ -33,7 +33,7 @@ class Artist(ImmutableObject):
name = None
def __eq__(self, other):
if other is None:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
@ -68,7 +68,7 @@ class Album(ImmutableObject):
super(Album, self).__init__(*args, **kwargs)
def __eq__(self, other):
if other is None:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
@ -133,7 +133,7 @@ class Track(ImmutableObject):
super(Track, self).__init__(*args, **kwargs)
def __eq__(self, other):
if other is None:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__