if your generated url is /a/c/f/*graf_comp_gior*?var1=a&var2=b I assure you
that those will be passed.
as for the graphing library, I highly suggest to switch to a javascript
based solution rather than a python one for any web site.
On Friday, May 6, 2016 at 8:50:21 AM UTC+2, Paolo Amboni wrote:
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.