Massimo, whats the right syntax to pass the variable to smart_query? U
mentioned list. But [db.table.field] gives u the dal object n the code
given me a error on line 110 in methods.py . U have isinstance (fields,
(list, tuple))). So I believe smart_query takes in list or tuple. But how
do I create a list or tuple from dal? I asked cuz it gives me a run time
error. If I do db ().select (db.table.field) that makes a set. What will
make a list/tuple so isinstance will b satisfied?  Whats the right way to
pass that variable into the routine. It cant b [db.table.field].
On Mar 6, 2015 1:06 PM, "Massimo Di Pierro" <[email protected]>
wrote:

> I agree with Leonel,
>
> is is better to make your own search. The all point of the grid is
> pagination of results. If that is not what you need, make your own search
> using this:
>
> from pydal.helpers.methods import smart_query
>
> list_of_searchable_fields = [db.table.field1, db.table.field2, ...]
>
> query = smart_query(list_of_searchable_fields, search_text)
>
> rows = db(query).select()
>
>
> This supports the same search syntax as the grid.
>
>
>
>
>
> On Friday, 6 March 2015 10:27:01 UTC-6, Leonel Câmara wrote:
>>
>> Well you can use LOAD to put the form there and then have the controller
>> redirect if it has results.
>>
>> But really it's much simpler to just make your own search.
>>
>  --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/xTCJzJrRuoo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

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