You can customize the search functionality by providing (a) a custom widget 
via the "search_widget" argument (it takes a list of searchable fields and 
a URL and should return a search form) and/or (b) a custom search query 
builder via the "searchable" argument (it takes a list of searchable fields 
and the keyword string from the search form and should return a DAL query 
object).

By default, the query builder is gluon.sqlhtml.SQLFORM.build_query -- so 
check that out to see how it works.

When you set advanced_search=False, all it does is disable the Javascript 
functionality of the search widget that facilitates the advanced search 
syntax (you can still manually enter advanced search syntax, and you will 
get an advanced search query). The build_query method looks for quotes in 
the keyword string and if found, it calls pydal.helpers.methods.smart_query 
to generate the query. Otherwise, it just does a basic search across text 
fields (which is what you are getting).

Anthony

On Saturday, December 3, 2016 at 9:27:39 AM UTC-5, Scott Hunter wrote:
>
> When using the basic (as opposed to advanced) search function of an 
> SQLFORM.grid, it only appears to look in text fields, such that if I enter 
> a number, it doesn't find any matches unless that number appears in a text 
> field (even if that field is not one of the ones displayed in the grid).
>
> Is this intentional?  Short of using the advanced search, is there a way 
> to search numeric fields?
>
> - Scott
>

-- 
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