i wasn't able to get back to this for a while, but the new
list:integer parts did it. to answer cfh's question, i was only seeing
it on development. i hadn't deployed to try it on production. and yes,
i was using sqlite for gae's dev.
i didn't have to use the patch, but thanks for the heads-up. it was
massimo's update that did it. once i changed from this:
Field('friends',gae.ListProperty(int))
to this:
Field('friends','list:integer')
the problem went away. thanks for the help.
matt
On Aug 11, 6:14 am, howesc <[email protected]> wrote:
> matt,
>
> are you seeing this on GAE production, or on your development server?
> if on development, are you using sqlite? if so, then
> seehttp://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/814b346bb0...
>
> 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
>
>