I'm not sure about this particular instance, but Templates are iterators I
think so you might be able to come up with somthing if you hack around with
the internals. Sorry I can't be more specific, but I don't have access to my
normal environment at the moment!
Ben



On 04/11/2007, Karen Tracey <[EMAIL PROTECTED]> wrote:
>
> On 11/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
> >
> > A view has a loop - each iteration may take 3 seconds, and it will loop
> > 20+
> > times, so 1 min of processing.
> >
> > Is there some way to dump stuff to the browser page each loop?
>
>
> No.  The only way to send stuff to a browser is to respond to an HTTP
> request, so if you want the browser to see regular status updates you'll
> have to set it up so that the browser makes periodic requests for status.
> I've never used this technique but here's a page describing a way to do it
> (along with pros and cons and questioning of do you really want to do this):
>
>
> http://webtips.dan.info/refresh.html
>
> Note that if you do this, the time-consuming processing you currently have
> in your view will have to be moved elsewhere, because the browser sees
> nothing until your view returns an HttpResponse.  Your view will have to
> kick off this other processing in a separate thread or process, and then
> return a response describing status.  When subsequent status requests come
> in, they will have to somehow be able to find out how far along the process
> is...you'll have to work out how to do that, whether by storing status in
> the database or a file or something.
>
> Actually even if you don't do the refresh thing, I think it would make
> sense to move that long-running code out of the view and provide for
> responding to queries on status.  A page that takes a minute to load is
> going to seem broken, even if users know it is supposed to take a long
> time.  In the year since they last ran it they're going to have forgotten
> how long it takes, and despite any warnings to "Click DOIT only once!"
> they're going to go back and click DOIT again....
>
> Karen
>
> >
>


-- 
Regards,
Ben Ford
[EMAIL PROTECTED]
+6281317958862

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to