ahh, perfect.  thanks for the clarification!

On Nov 20, 5:35 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I would say imprecise.It can be mimiced using
>
> .select()|..select()  and ..select()&..select() etc.
>
> On Nov 20, 1:22 am, howesc <how...@umich.edu> wrote:
>
> > oh, so the recent post (http://groups.google.com/group/web2py/
> > browse_thread/thread/e7a8240881564270) that says belongs in GAE was
> > made available in version 1.69.1 is incorrect?
>
> > On Nov 19, 8:10 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > GAE does not support belongs and does not support OR. You have to do:
>
> > > rows = db(db.media_type.name=='paper').select()&db
> > > (db.media_type.name=='cd').select()
>
> > > The & is done at the web2py level but since records are exclusive and
> > > you are not sorting them, there is no major slowdown.
>
> > > Massimo
>
> > > On Nov 19, 5:49 pm, howesc <how...@umich.edu> wrote:
>
> > > > Hello,
>
> > > > I'm using Google App Engine, and trying to make use of the new
> > > > 'belongs' feature in queries (thanks much for adding it in!), and am
> > > > having a problem.  It seems that when i construct the query my list is
> > > > being converted to a unicode string, and then the query generation
> > > > code fails.
>
> > > > here's my model:
>
> > > > db.define_table('media_type',
> > > >     Field('name', 'string', notnull=True, unique=True,
> > > >           requires=[IS_NOT_EMPTY(),
> > > >                     IS_NOT_IN_DB(db,'media_type.name')]))
>
> > > > here's my query:
>
> > > >   rows = db(db.media_type.name.belongs(['paper', 'cd'])).select()
>
> > > > here's the error:
> > > >   /cfhowes/clients/rockriver/source/web2py/applications/rockriver/
> > > > controllers/manage.py:song_media", line 68, in song_media\n  File "/
> > > > home/cfhowes/clients/rockriver/source/web2py/gluon/contrib/gql.py",
> > > > line 666, in select\n    (items, tablename, fields) = self._select
> > > > (*fields, **attributes)\n  File "/home/cfhowes/clients/rockriver/
> > > > source/web2py/gluon/contrib/gql.py", line 617, in _select\n    items =
> > > > items.filter(cond, val)\n  File "/home/cfhowes/Desktop/gae/
> > > > google_appengine/google/appengine/ext/db/__init__.py", line 1882, in
> > > > filter\n    raise BadValueError(\'Argument to the "in" operator must
> > > > be a list\')\nBadValueError: Argument to the "in" operator must be a
> > > > list\n
>
> > > > (sorry, it's how i copied it out of the GAE viewer....)
>
> > > > Here's my proposed solution - but I don't understand what i did well
> > > > enough to know the potential other side effects.  If I modify gql.py
> > > > (from Version 1.72.3 (2009-11-10 09:17:13)) and add the following at
> > > > line 460:
>
> > > >         elif isinstance(obj, list):
> > > >             obj = obj
> > > > which keeps the check a few lines later from converting my list to a
> > > > unicode string.  my query now works.
>
> > > > so, did i do something wrong in my query, or is this fix (or something
> > > > similar) needed to make belongs work in the latest build?
>
> > > > thanks,
>
> > > > christian
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to