On Jul 4, 2:26 am, Tai Lee <[EMAIL PROTECTED]> wrote:
> > The only thing that might be worth doing in this are is adding a way to
> > say "middleware should never be called on this response" and then
> > somebody can write their own HttpResponse subclass and be in complete
> > control of their destiny.
>
> Would this disable ALL middleware from running? Or only the
> process_response methods on middleware? Either way, this is not ideal
> as there are useful middleware that CAN still work with on-demand
> content (e.g. the updated GZipMiddleware from the patch).

+1 for adding a way to say "process_response should never be called on
this response".

Taking a quick look at the source, HttpResponse seems to support
iteration already:

    def __iter__(self):
        self._iterator = iter(self._container)
        return self

    def next(self):
        chunk = self._iterator.next()
        if isinstance(chunk, unicode):
            chunk = chunk.encode(self._charset)
        return str(chunk)

I'd expect this is actually used in returning content, i.e. if no
middleware kicks in, passing an iterator to HttpResponse should just
work for streaming?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to