On Jun 26, 1:16 am, koranthala <koranth...@gmail.com> wrote:
> On Jun 26, 2:21 am, Kevin Teague <ke...@bud.ca> wrote:
>
> > Presumably you already have all of the data required to generate a
> > chart on the server? If so, then store the chart data in a model, and
> > just reference it by id. e.g.
>
> > <img src="/chart?id=834765" />
>
> > (or w/ a pretty URL: <img src="/chart/834765" />)
>
> > And create a Chart object and store it before sending out the HTML
> > response. Then update your chart view so that it fetches that object
> > and uses it as input to generate the graph.
>
> The data required to create the chart is calculated from the server. I
> can create a model and store it, but when should I delete the same?
> Once the image is created? In case the image is not created - say full
> page did not load - before that the user closed it etc. In such case,
> how do I delete the stored data?
>
> Also, is it good to store these temperory data in models?

If your image is meant for one-time use by one user, you could store
the data in that user's session. Then ensure that you clear expired
session data by following instructions here:
http://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs#clearing-the-session-table

-RD

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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