On Thu, Feb 19, 2009 at 9:04 AM, Adam Stein <a...@eng.mc.xerox.com> wrote:
> > Thanks Kevin and Malcom for responding. > > Kevin is right in that I don't need AJAX. I came up with a different > method that also allows me to change the string above my progress bar to > reflect what I'm actually doing at the moment. > > My method (roughly) involves setting the HTTPResponse content to an > iterator and having the iterator split a rendered template. It yields > the first part which would load the progress bar and display it. Then > it calls a passed in callback function to do the actual processing, then > yield the last part of the rendered template which would turn the > progress bar off. If anybody is interested, I can post code and go > through exactly what I do. > You might want to read: http://code.djangoproject.com/ticket/6527 My sense from that ticket (and other half-remembered discussions of iterators and HttpResponses) is that, if this is working for you now, you are just lucky you don't have any middleware consuming your iterator before it actually gets sent as a response. In the future when that ticket is fixed I believe the element of luck will go away and you'll be guaranteed all of your iterator response content will be sent, but sending the beginning of the response will have to wait until the full response is generated, so it won't accomplish the progress display you are attempting to show by using this technique. Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---