[google-appengine] Re: Entity Equality

2009-02-21 Thread Alexander Kojevnikov
On Feb 22, 12:51 pm, MajorProgamming wrote: > I currently have a need to take a result from a query (which is a > list) and remove one entity from it. For some reason though when I > perform the remove, I get an error which says that the entity does not > exist on the list. How can I do this corr

[google-appengine] Re: Entity Equality

2009-02-22 Thread Paul Roy
i believe this as to do with how object instances are evaluated for equality in python. ive had a similar issue and if i recall correctly (im on my phone atm and not close to my code), i needed to implement __eq__ & __ne__ (or whatever non equal is, i cant remember) to my Model object subcl

[google-appengine] Re: Entity Equality

2009-02-22 Thread pedepy
here's what i had to add to get set of queries to intersect: def __hash__(self): return hash(self.key()) def __eq__(self, other): return self.key() == other.key() def __ne__(self, other): return not self == other i dunno if thats optimum but it works ..