matt, are you seeing this on GAE production, or on your development server? if on development, are you using sqlite? if so, then see http://code.google.com/p/googleappengine/issues/detail?id=3232 i had to patch GAE dev server to work properly in this case.
if that is not the case i'm sure it has to do with the special way that keys and list properties are handled in GAE. since friends is a list, what about the contains operator? (just a thought but i don't think that works either). maybe best is to try massimo's new update in trunk: http://groups.google.com/group/web2py/browse_thread/thread/814b346bb00f0bcb cfh On Aug 10, 10:44 am, mattynoce <[email protected]> wrote: > hi all. i have an interesting problem with & in gae and wanted to see > if i could get some thoughts. > > in my program, i have used & in queries many times and had it work. > for example, query A works fine: > (A) db((db.timeframe.isActive==True) & > (db.timeframe.userID==15)).select() > > but query B does not: > (B) db((db.auth_user.id==1) & (db.auth_user.friends==2)).select() > > in this example, the auth_user table has been adjusted to include a > GAEListProperty called friends. user with id 1 (user1) and user with > id 2 (user2) are friends. > > if i call this query: > (C) db((db.auth_user.id==1).select() > it returns user1. > > if i call this query: > (D) db((db.auth_user.friends==2).select() > it returns user1. > > but if i put them together into query E: > (E) db((db.auth_user.id==1) & (db.auth_user.friends==2)).select() > it returns no one. > > if i change either variable to use another custom field, points: > (F) db((db.auth_user.points==0) & (db.auth_user.friends==2)).select() > (G) db((db.auth_user.id==1) & (db.auth_user.points==0)).select() > it returns user1. > > and if i use an inequality: > (H) db((db.auth_user.id>0) & (db.auth_user.friends==2)).select() > it returns user1 (and anyone else who is friends with user2). > > so the only problem is the case i need, which is to see if user1 is > friends with user2. i can easily solve this with a loop but it seems > silly when i should be able to just use the DAL. can anyone see why > query E won't work when all the rest will? is it possible it's an > implementation issue? > > thanks, > > matt

