Ah, could be. I'm still new to the GAE datastore. I'll look into the
indexes.

Thanks
Dave


2011/8/17 Massimo Di Pierro <massimo.dipie...@gmail.com>

>
>
> On Aug 17, 10:52 am, fishwebby <pastelva...@gmail.com> wrote:
> > Hi, I've got the following query to select auth_users from a list of
> > IDs, then ordered by name:
> >
> > users = db(db.auth_user.id.belongs((1,2,3))).select(orderby =
> > db.auth_user.first_name)
>
> This should work. Could be that you need a index?
>
> >
> > which works fine in sqlite, but when deployed to gae the orderby
> > doesn't work. Do belongs and orderby not work together in gae?
> >
> > NB. There does seem to be an issue about it, but the page (about the
> > fifth result with this Google search:
> http://www.google.es/search?q=web2py+belongs+orderby+gae)
> > on the issue tracker gives a 502 error at the moment so I can't read
> > it...)
> >
> > I could get around it by sorting in Python afterwards, e.g.
> >
> > users = (db(db.auth_user.id.belongs((1,2,3))).select()).sort(lambda
> > row:row.first_name)
> >
> > would this be computationally expensive for a large dataset or is this
> > an acceptable workaround?
> >
> > Many thanks
> > Dave
>

Reply via email to