Hi All,
I am using uuid to create new temporary files for PYGAL chart.
Although I can see the file being created and available in the file system.
Even I can view the file in the browser, however when I serialize the path
variable to be passed to the view, I get an error - A 404 not found error
is shown inside a frame in my view. How do I serialize the path at runtime
to src= in the view such that it should take the path that I have
constructed using dynamicLinechartpath.. ? Below is the code
unique_filename = (str(uuid.uuid4()) +'.svg')
##...other code
## This creates the file in the file system
linechart.render_to_file(os.path.join(request.folder,'static/charts/' +
unique_filename))
## Constructing the path to pass to the view
dynamicLinechartpath = (""" "{{=URL(r=request, c='static', f='charts/""" +
unique_filename + """')}}" """)
Calling the path in view -
<figure>
<embed type="image/svg+xml" src={{=dynamicLinechartpath}} />
</figure>
I have tried
src="{{=dynamicLinechartpath}}
but it does not work. Is this proper approach ? What am I doing wrong?
Here is what 'response.flash' shows me in my view when I try to check what
is being passed. which I think is looking good.
"{{=URL(r=request, c='static',
f='charts/bf094fa3-a711-4118-a3aa-89f647cca4f1.svg')}}"
Please suggest,
Rahul D.
--
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.