>
> i tried with
> prodotti = legacy_db().select(legacy_db.prodotti.SupplierID==fornitore)
> but i got error:
> AttributeError: 'Query' object has no attribute 'type'
>
> Then i tried with:
> prodotti = legacy_db(legacy_db.prodotti.SupplierID==fornitore).select( )
> and this worked.
> My questio is : why the first form does not work?
> Shuoldn't they be equivalent?
> how should i translate the where condition in the select part?
>

Why should they be equivalent? The second one is the way the DAL API has 
been defined -- you create a Set object (i.e., a query defines a set of 
records), and then apply a method (e.g., .select, .update, .delete) on that 
set. In this case, the .select method is where you specify things like the 
fields to select, orderby, etc.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to