request.args[0] from the destination request. Yes, eval is the only way to 
solve this, but because it is so dangerous, I dismissed the idea.

The original idea was to have a shared function (in another controller) 
that would be used by several controllers, each with specific queries that 
would be passed to the destination using session. The queries would be 
passed as strings to be executed only at the destination.

Due to the dangerous nature of eval and been the only solution, I've given 
up on that and repeated the code in each table controller's (with the 
specific query for each of course).

Thank you all for the help.


sexta-feira, 3 de Maio de 2019 às 04:01:00 UTC+1, Anthony escreveu:
>
> On Wednesday, May 1, 2019 at 4:53:25 PM UTC-4, [email protected] 
> <javascript:> wrote:
>>
>> Got the answer in the Telegram chat. Using eval.
>> It's a dangerous solution but works.
>>
>
> So dangerous you probably shouldn't do it.
>
> Also, do you want to use the value of request.args[0] from the original 
> request where the query is saved to the session, or from the subsequent 
> request where the query is retrieved from the session? Storing the query 
> object itself would achieve the former, whereas using eval would achieve 
> the latter.
>
> In either case, the best approach is just to store the data needed to 
> generate the query in the session (e.g., table and field name, and the 
> request.args value). Then construct the query in the second action. There 
> is no need to store the query itself (or a text representation of the query 
> code).
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to