I have re-factored a lot of code in gluon/contrib/gql.py in order to
make it leaner, more readable and add new syntax. Now you can do mix
and match queries like:
q1=(
db.table.id==1)
q2=(
db.table.id>0)
q3=(db.table.field.belongs(('value1','value2','value3')))
in expressions like
db(q1)(q2)q3).select()
db(q1&q&q3).select()
db(...).update(...)
db(...).delete()
Before this patch, belongs was not supported by web2py on GAE, q1 and
q2 could not be mixed with other conditions.
Now you can do for example:
d=datetime.date.today()
db.define_table('person',Field('name'),Field('birthday','date'))
db.person.insert(name='John',birthday=d)
rows=db(
db.person.id>0)(db.person.name.belongs(('John',))).count()
rows=db(
db.person.id==1)(db.person.name.belongs(('John',)))\
(birthday==d).update(name='Jim')
Moreover the db['_lastsql'] now contains a complete representation of
the last query on GAE and it can be used for debugging, and both db, db
(...) and can serialized as a string.
Please check it and report any problem.
Also please let me know if you find places in the online documentation
that have just become obsolete.
Massimo