Hi,
Is it possible to pass the request vars and call the function 
dynamic_search twice?
redirect(URL("test",vars=request.vars))



Am Mittwoch, 17. Juli 2013 18:46:07 UTC+2 schrieb Massimo Di Pierro:
>
> You can store the results in session then.
>
> session.rows = db(...).select()
>
> Passing to much data in request.vars can be a problem. For example nginx 
> limits the size of the query string.
>
>
>
>
> On Wednesday, 17 July 2013 10:48:15 UTC-5, Dmitri Husti wrote:
>>
>> HI,
>> you can pass results to the next page;
>> redirect(URL("test",vars=dict(results=results))
>>
>> On the next page you can do 
>> return dict(results=request.vars["results"])
>>
>> Am Mittwoch, 17. Juli 2013 12:37:24 UTC+2 schrieb Sarbjit singh:
>>>
>>> Hi,
>>>
>>> I am trying to use "dynamic search form" from 
>>> http://www.web2pyslices.com/slice/show/1403/dynamic-search. Current 
>>> implementation shows both the form and results on the same page.
>>>
>>> I want to display the search results (using GRID) in a new page and 
>>> wants to use customized forms for edit/view operations associated with GRID.
>>>
>>> As of now, I tried handling it in the view to not to show form contents 
>>> once the form is accessed but some how it is not working on subsequent 
>>> operations.
>>>
>>> So, I am thinking to pass query to a new controller and can hence handle 
>>> the custom forms there. But I am not able to do so.
>>>
>>> So here is what I tried :
>>>
>>> @auth.requires_login()  
>>> def search2():
>>>     form,query = dynamic_search(db.customer)
>>>     if form.process().accepted:
>>>         session.sqlquery = query
>>>         redirect(URL('results'))
>>>     return dict(form=form)
>>>
>>> @auth.requires_login()         
>>> def results():
>>>     query = session.sqlquery
>>>     print query
>>>     results =  
>>> SQLFORM.grid(query,searchable=False,create=False,csv=False)
>>>     results = None
>>>     return dict(results=results)
>>>
>>> With this code, first error that is encountered is in "session.sqlquery 
>>> = query" -> Can't pickle objects ....
>>>
>>> So I modified it as 
>>>
>>> session.sqlquery = str(query)
>>>
>>> With this error appeared in "query = session.sqlquery" -> str object has 
>>> no attribute _db
>>>
>>> Can some one please suggest what is the right way to achieve this?
>>>
>>> -Sarbjit
>>>
>>>

-- 

--- 
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/groups/opt_out.


Reply via email to