If I understand, you mean that whenever I call JQPlot

    jqplot = JQPlot(*args, col_represent=str)

I have to append the following lines:

        response.files.append(URL('static', 'jqplot/jquery.jqplot.min.js'))
        response.files.append(URL('static', 'jqplot/jquery.jqplot.min.css'))
        response.files.append(URL('static',
'jqplot/plugins/jqplot.barRenderer.min.js'))
        response.files.append(URL('static',
'jqplot/plugins/jqplot.categoryAxisRenderer.min.js'))
        response.files.append(URL('static',
'jqplot/plugins/jqplot.pointLabels.min.js'))

or at least a call like

        jqplot = JQPlot(*args, col_represent=str)
        add_jqplot_static_files()

to avoid repetition.

yeah, that would sure work, but still: any other ideas?

I'm specifically interested in knowing why

        current.response.files.append(URL('static',
'jqplot/jquery.jqplot.min.js'))
        current.response.files.append(URL('static',
'jqplot/jquery.jqplot.min.css'))
        current.response.files.append(URL('static',
'jqplot/plugins/jqplot.barRenderer.min.js'))
        current.response.files.append(URL('static',
'jqplot/plugins/jqplot.categoryAxisRenderer.min.js'))
        current.response.files.append(URL('static',
'jqplot/plugins/jqplot.pointLabels.min.js'))

in the module does not work. I get the feeling that I will stump into
that wall more times if I just hack my way around the problem now.

El 13/08/14 a las #4, Cliff Kachinske escribió:
> Put the appending code in the controller.
>
> On Wednesday, August 13, 2014 7:14:46 AM UTC-4, pa...@cancamusa.net
> wrote:
>
>
>     Dear all:
>     In the process of moving functionality from models to modules, I'm
>     trying to add some filesto the header. When the file was in
>     models, I did:
>
>             response.files.append(URL('static',
>     'jqplot/jquery.jqplot.min.js'))
>             response.files.append(URL('static',
>     'jqplot/jquery.jqplot.min.css'))
>
>     now that it's in modules, I tried:
>
>             current.response.files.append(URL('static',
>     'jqplot/jquery.jqplot.min.js'))
>             current.response.files.append(URL('static',
>     'jqplot/jquery.jqplot.min.css'))
>
>     but it doesn't work...
>     I've found a workaround, the last line in JQPlot.xml was:
>
>             return current.response.render('jqplot.html', d)
>
>     so I can add "script" html tags to the template jqplot.html:
>
>     <script src="/karakolas/static/jqplot/jquery.jqplot.min.js"></script>
>     <script src="/karakolas/static/jqplot/jquery.jqplot.min.css"></script>
>
>     but I'm sure it can be done better...
>     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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/1h3Ni_iywzY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com
> <mailto:web2py+unsubscr...@googlegroups.com>.
> 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to