if you want to offer lots of properties one can change, POST via ajax is the
better way - as you said
long URLs can get very ugly - although you could shorten them like youtube
or others do it.
GET is far better at this point of time, as only GET requests are cachable
(as far as I know) by djangos
middleware.

if I understand you right: you want to mix html with image-data? That is
impossible. But you can
add parameters to the header of the http response of the image and put in
there all settings needed to render the image...
So you need 2 urls - although you could add a second variable to the url
e.g. output:
url(r'^graph_example/(?P<id>\d+)/(?P<output>\w+)/$')

and then a view:

def myview(request, id, output):
   if output == 'image':
     # output image data
   else:
      # output html data



2009/12/26 heaviside x <mcdevi...@gmail.com>

> Hello,
>
> To start, this is not another how do I get matplotlib to work in
> Django thread.  This is how do I get matplotlib to work better with
> django.  Before I go on, let me outline what I'm doing.
>
> I'm currently working on a scientific data manager/viewer which uses
> matplotlib as the primary graphing workhorse.  My intention is to be
> able to easily handle all sorts of crazy scientific plots (Smith
> Charts, Polar Plots with negative values, and other crazy mappings).
> In the past, matplotlib has been able to easily and elegantly handle
> these charts, so I'm sticking with it for now.  I also want to be able
> to take these generated plots and quickly dump them into documents or
> reports so a save functionality (or drag and drop via the browser) is
> key.
>
> Currently, my application is based off the standard matplotlib
> example.  I have a webpage that contains a static graph.png image and
> I point that url to another view that renders my matplotlib png and
> returns it.
>
> url(r'^graph_example/(?P<id>\d+)/$')
> url(r'^graph_example/(?P<id>\d+)/graph.png')
>
> How should I implement editable scales, titles, and labels?  For
> instance, the graph comes up but I want a different scaling for a
> report.  I could add all this information as url variables to the
> view, but that would be extremely ugly.  Is the simple solution a
> query string?  However, this also yields very ugly URLs.
>
> Instead of just returning an image in the HttpResposne as the django/
> matplotlib example shows, is there a way to return the image with the
> rest of the base page's response?  Removing the need for hard coding a
> "graph.png" url into my template.
>
> Any help would be greatly appreciated.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to