Ticket #16458: models_equality-16458.diff
File models_equality-16458.diff, 619 bytes (added by , 13 years ago) |
---|
-
django/db/models/base.py
382 382 return '%s object' % self.__class__.__name__ 383 383 384 384 def __eq__(self, other): 385 return isinstance(other, self.__class__) and self._get_pk_val() == other._get_pk_val() 385 return (isinstance(other, self.__class__) or isinstance(self, other.__class__)) and \ 386 (self._get_pk_val() == other._get_pk_val()) 386 387 387 388 def __ne__(self, other): 388 389 return not self.__eq__(other)