Thanks a lot Val and Thiago for your help, it's perfect.

Il giorno sabato 4 aprile 2020 16:36:13 UTC+2, Gaël Princivalle ha scritto:
>
> Hello.
>
> How can I build a query in 2 steps?
>
> query = db.products.type == 1
> query = query and db.products.stock > 0
>
> The final result must do something like that:
> fruits = db((db.products.type == 1) and (db.products.stock > 0)).select()
> Made like this:
> fruits = db(query).select()
>
> Thanks!
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6bdc4640-063f-49f4-b8f4-3aaa631dc08e%40googlegroups.com.

Reply via email to