I hope I didn't post a read the manual question again, but doesn't seem to be documented in the DAL section.
Thanks
Alan Etkin
unread,
Jan 28, 2013, 5:21:45 PM1/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
I have noticed this behavior in trunk. Is this a feature?
I belive I found the problem: the Query class doesn't implement __eq__ nor __ne__. Is that the cause?
Anthony
unread,
Jan 28, 2013, 5:39:07 PM1/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
According to the Python documentation:
If no __cmp__(), __eq__() or __ne__() operation is defined, class instances are compared by object identity (“address”).
The Query class doesn't define any of those operations, so object identity will be used, hence the False value (i.e., each query is a separate object with a separate identity). Instead, you can do:
repr(q)== repr(q2)
Anthony
Anthony
unread,
Jan 28, 2013, 5:41:05 PM1/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
repr(q)== repr(q2)
I suppose we could implement __eq__() and __ne__() methods that do the above.
Anthony
Alan Etkin
unread,
Jan 28, 2013, 5:44:50 PM1/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
repr(q)== repr(q2)
+1 for the repr comparison, as long as it's backwards compatible and it doesn't have conflicts with other query operations
Massimo Di Pierro
unread,
Jan 28, 2013, 9:49:32 PM1/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
Good idea Anthony, can you send me a patch?
Alan Etkin
unread,
Jan 30, 2013, 6:18:33 AM1/30/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message