what version of web2py are you using? belongs was not supported on ID at one point, but we fixed that i believe....
anyhow, i would write the queries for GAE like:
# Construct a query to fetch all the mootid's from the group
mootGroup =
db(db.moot_groups.gid==groupid).select()
###NOTE: you may only have up to 30 items in a belongs (IN) statement on GAE, you might need to split the following into multiple queries
# Gets moots only if the moot ID exists in the Group query
moots =
db((db.moots.url==request.get_vars.url)&(
db.moots.id.belongs([
r.id for r in mootGroup]))).select(db.moots.ALL)
good luck, and ask questions - i'm running several apps of various sizes on GAE so hopefully myself and others can guide you through the GAE pitfalls!
cfh