>
> I'm a little puzzled by the common_filter syntax.  It looks a 
>> common_filter must be a function that takes a single argument, query, and 
>> returns a query that, in the book examples at least, doesn't reference the 
>> argument.  I'm guessing that the argument is the query that would be 
>> executed if the common_filter was None, right?  So does is the query that 
>> gets finally executed equivalent to db(query & common_filter) ?
>>
>
Yes, that's basically it, though it will add the common_filter query for 
all tables involved in the select. See 
http://code.google.com/p/web2py/source/browse/gluon/dal.py#1255 and 
http://code.google.com/p/web2py/source/browse/gluon/dal.py#1720 to see 
what's happening. In the for loop, the current query is always passed to 
the common_filter function -- I'm not sure what use case that is supposed 
to support, but obviously you can just ignore it in your function.

Anthony  

Reply via email to