On May 13, 9:19 pm, robotmurder <roscoedes...@gmail.com> wrote:
> 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 <gamesb...@gmail.com> wrote:
>
>
>
> > On May 1, 4:39 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote:> On 
> > Sat, May 1, 2010 at 7:22 AM, Joshua Russo <josh.r.ru...@gmail.com> 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

Thanks for the ideas - not sure _I_ will use them though.

"I usually keep a boolean field in the table for processing." - I
don't really want to change my existing models; and anyway, data from
the uploads usually get processed into multiple models (which vary
depending on the data in the file) so this approach is too simplistic
for my needs.

"If it's a large file I would use something like swfupload" - for a
number of reasons I am "Flash averse" so I would look for some other
way of tracking the upload status (of course, this does not deal with
the main issue of processing the file once it _is_ uploaded).

Anyone else with ideas or "best practices"?

-- 
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