Open forcefield opened 14 years ago
The current implementation of eq, cmp in SphinxProxy violates symmetry. For instance, suppose you have
a = Object() b = SphinxProxy( a )
You have b==a return True, but a==b return False, and even b==b return False.
This makes it awkward to use SphinxProxy object directly in further queries, such as
get_object_or_404( id = b )
will fail because it is trying to use the eq operator treating b as the second argument.
Any way to improve this behavior?
The current implementation of eq, cmp in SphinxProxy violates symmetry. For instance, suppose you have
a = Object() b = SphinxProxy( a )
You have b==a return True, but a==b return False, and even b==b return False.
This makes it awkward to use SphinxProxy object directly in further queries, such as
get_object_or_404( id = b )
will fail because it is trying to use the eq operator treating b as the second argument.
Any way to improve this behavior?