>
> Hm, but how does it know to return a set object from the product_filter
> table rather than the product or filter table?
Set objects are not associated with a particular table -- they represent a
set of records to be returned by the db, which may involve a join of
multiple tables. Basical
it's explained here:
http://web2py.com/books/default/chapter/29/06#Many-to-many
Den tisdagen den 21:e maj 2013 kl. 22:02:00 UTC+2 skrev brac...@gmail.com:
>
> Is there a section in the online web2py book that explains Niphlod's way
> to building a query?
>
> Near the bottom of this
> thread
all those (query) just add a bit of "where" clause in the select that you
pass to the db.
you can use them with db((query) & (query) & (query)) or with
db(query)(query)(query) ... the resulting select passed to the db would be
the same!
On Tuesday, May 21, 2013 10:43:48 PM UTC+2, brac...@gmail.
Hm, but how does it know to return a set object from the product_filter
table rather than the product or filter table?
And what does these two queries mean when it comes executing the queries?
(db.products.id == db.product_filter.product_id) &
(db.filters.id == db.product_filter.filter_id
Note, I'm not sure the fact that a Set is callable is documented in the
book.
On Tuesday, May 21, 2013 4:14:48 PM UTC-4, Anthony wrote:
>
> db(some_query) creates a DAL Set object (on which you can then call
> methods such as .select(), .update(), etc.). A Set object is also callable,
> and if
db(some_query) creates a DAL Set object (on which you can then call methods
such as .select(), .update(), etc.). A Set object is also callable, and if
you call it by passing in another query, it will simply add the new query
as an AND condition. So, that code is just equivalent to:
db(
(db.
6 matches
Mail list logo