﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11892	Model __eq__ is not symmetric.	pmcnerthney@…	nobody	"The Model test for equal implemented in eq is not symmetric. A non-deferred instance compares equal to a deferred instance, but a deferred instance compares unequal to a non-deferred instance.  This is due to the following implementation of eq:

{{{
    def __eq__(self, other):
        return isinstance(other, self.__class__ and self._get_pk_val() == other._get_pk_val()
}}}

This needs to be changed to:

{{{
    def __eq__(self, other):
        return (isinstance(other, self.__class__) or isinstance(self, other.__class__)) and self._get_pk_val() == other._get_pk_val()
}}}
Which allows for complete symmetric of comparisons.
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		Colin Copeland anssi.kaariainen@… marti@…	Ready for checkin	1	0	0	0	0	0
