Usually when I do this for an upload, etc... it means that a user just
did something that resulted in an row being created in the db. I
usually keep a boolean field in the table for processing. Then when I
load the next page I can just query that value right before I choose
the template to see if it's done processing, if it's done show the
result page, if not show the processing page and send the id of that
process along so I can query it using ajax every so often to see if
it's done then load the results page.

Progress is a little harder. If it's a large file I would use
something like swfupload to show the user real time progress on the
page before loading the next page.

If there is a better way to do these things, I'd love to know too.

On May 13, 4:14 am, derek <[email protected]> wrote:
> On May 1, 4:39 pm, Javier Guerra Giraldez <[email protected]> wrote:> On 
> Sat, May 1, 2010 at 7:22 AM, Joshua Russo <[email protected]> wrote:
> > > This is mainly just curiosity at the moment. How do you create a
> > > "processing" intermediate page, like you see on travel sites when they are
> > > looking for the rates? I would always avoid this if at all possible, but
> > > sometimes you have a process that takes longer than usual.
>
> > some ideas:
>
> > - a view checks if the task is done, if so, shows the result.  if not,
> > uses another template with the 'wait a sec..' message and a 'refresh'
> > HTML header that reloads the page after a few seconds.
>
> I am curious as to how a view would actually "check if the task is
> done"?  In my case, I would be uploading and processing a large file
> which could take some time.  How would the view "know" that how far
> that file processing has progressed ... should it be writing out to a
> temp file which the view could "read"?  What if there are multiple
> uploads occurring at the same time?  Or are there simpler, more
> "Django-orientated" methods of doing this?
>
> Thanks!
> Derek
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to