Same problem!
the args and var are not passed to the receiving function in this specific 
case.
(I tried both args and vars alone first).
With session all works fine.

I find very complex the way web2py handle matplotlib plots.
Is there other plotting library that better integrate in web2py framework? 

Il giorno giovedì 5 maggio 2016 10:11:45 UTC+2, Niphlod ha scritto:
>
> there's a problem in your syntax.
>
> it's usually URL('blabla', args=[], vars=dict())
>
> while your code reports
>
> args=[..., dict=()]
>
> On Thursday, May 5, 2016 at 9:53:44 AM UTC+2, Paolo Amboni wrote:
>>
>> I stored the id in a session variable and it works fine!!
>> But why the URL helper didn't send the args to the function?
>>
>> Il giorno giovedì 5 maggio 2016 09:36:32 UTC+2, Paolo Amboni ha scritto:
>>>
>>> I'm trying to build a single function (in a controller) that generate 
>>> different matplotlib graph..
>>>
>>> So the function that generate the stream works fine:
>>> *def grafico*(title='title',xlab='x',ylab='y' data=.... ):
>>>      fig=Figure()
>>>      ....
>>>      return stream.getvalue()
>>>
>>>
>>> the function that call the privious *works fine but not as i want:*
>>>
>>>
>>> *def graf_comp_gior*():
>>>     test_id=1 # *I need to set the id on the fly*
>>>     print response.args # *Always none why?*
>>>     print response.vars #*Always none why?*
>>>
>>>     rows = db(db.tat.id_test==test_id).select()
>>>     tat=pd.DataFrame(rows.as_list())
>>>     .... #manupulate the data as i need
>>>
>>>     graf=grafico(........)
>>>     
>>>     return graf
>>>
>>> This is the view with the embedded graph works fine:
>>>
>>> {{{extend 'layout.html'}}
>>> <h1>TAT completi per l'analisi {{=variabili['anal']}}</h1>
>>> {{=IMG(_src=URL('graf_comp_gior',
>>> *args=[argomenti[0],vars=dict('id'=argomenti[0])]))}} **How can i pass 
>>> some data to the previous function?*
>>>
>>> *Do i need to store them in a session?*
>>> *Thanks!!*
>>>
>>

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