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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---