On Thursday, September 27, 2018 at 2:07:31 AM UTC-4, Armando Hernandez 
wrote:
>
> How can i filter tha value of the autocomplete values of a 
> SQLFORM.widgets.autocomplete(request,db.person.name)
>
> Lets say you only want the autocomplete widget to display person names of 
> persons with ages beetwen 30 to 35 years old 
>
> Something like : 
> Filter=(db.person.age>=30) & (db.person.age<=35) ? 
>
> Thanks
>

I haven't tried it, but try:

SQLFORM.widgets.autocomplete(request,db.person.name, db=db(Filter))

db(Filter) returns a Set object, which is callable, just like db() -- so 
additional queries can be added by the widget.

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to