thank you very much Anthony. You are SUPER.
Il giorno lunedì 15 ottobre 2018 14:31:28 UTC+2, Anthony ha scritto:
>
> def custom_search(fields, keywords):
> [generate a DAL query based on fields and keywords]
> return query # Will eventually be used like db(query).select(...)
>
> grid =
def custom_search(fields, keywords):
[generate a DAL query based on fields and keywords]
return query # Will eventually be used like db(query).select(...)
grid = SQLFORM.grid(..., searchable=custom_search)
The "fields" argument is a list of the DAL field objects from the table
used to
Thank you Anthony, but the code is not easy to understand. could you make
me an easy example about to create a custom search function? Do I have to
write the code in my controller default.py? Or do I have to change the code
in the standard file sqlhtml.py (I don't think so).
Thank you
Il
The "searchable" argument can be a function that takes the list of fields
in the grid and the submitted keywords and returns a DAL Query object, so
you can create a custom search function. For an example, see the default
search
function:
4 matches
Mail list logo