>>> person = db.personYou can also store a field in a variable such as name. For example, you could also do:
>>> name = person.nameYou can even build a query (using operators like ==, !=, <, >, <=, >=, like, belongs) and store the query in a variable q such as in:
>>> q = name=='Alex'When you call db with a query, you define a set of records. You can store it in a variable s and write:
>>> s = db(q)Notice that no database query has been performed so far. DAL + Query simply define a set of records in this db that match the query. web2py determines from the query which table (or tables) are involved and, in fact, there is no need to specify that.
" Chapter 6: The database abstraction layer" is licensed under Creative Common License BY-NC-ND 3.0