GAE has added a feature so you can query by id or keyname (using
__key__), it is not implemented in DAL yet.

http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Queries_on_Keys

Robin



On Oct 5, 8:07 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> GAE is very weird. It does allow queries that mix queries by ID and by
> other fields.
> You must first search by ID, then check that other condition is valid:
>
> query = (self.db.assessmentQuest.id == nQuestId)
> rows = self.db(query).select()
> if not rows or rows[0].candidate_id != userId:
>     do_something
>
> On Oct 5, 5:55 am, Carl <carl.ro...@gmail.com> wrote:
>
> > this one has been floored
>
> > the following works correctly locally (sqlite) but trips over when
> > running on dev_appserver
>
> > query = (self.db.assessmentQuest.candidate_id == userId) &
> > (self.db.assessmentQuest.id == nQuestId)
> > rows = self.db(query).select(self.db.assessmentQuest.ALL)
>
> > It's the self.db.assessmentQuest.id that tripping execution with ***
> > Query' object has no attribute 'left' ***
> > If I remove this condition the code runs through fine and then trips
> > on the following with the same error...
>
> > if rows:
> >     return rows[0].id
>
> > and yet the following runs fine on dev_appserver:
> > if rows:
> >     id = rows[0].id
> >     return id
>
> > I'm totally foxed. Anyone an idea what's causing this behaviour?
--~--~---------~--~----~------------~-------~--~----~
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