Re: [RFC] Fixing middleware/view decorator handling of content iterators

2010-02-18 Thread Forest Bond
Hi, Thanks for your response, Russ. Let me put my use case out there to ground my responses a bit. I'm using Rackspace Cloud Files, a cloud storage service, to store large files (several hundred megabytes up to a few gigabytes in size). I need to serve these files to authenticated users via a v

Re: [RFC] Fixing middleware/view decorator handling of content iterators

2010-02-18 Thread Tom Evans
On Thu, Feb 18, 2010 at 12:00 PM, Russell Keith-Magee wrote: ... > benefit of using an iterator in the first place. So -- I suppose the > bigger question that needs to be asked is what exactly is the use case > for an iterable response? I mean, I understand the general benefit of > using iterators

Re: [RFC] Fixing middleware/view decorator handling of content iterators

2010-02-18 Thread Russell Keith-Magee
On Tue, Feb 16, 2010 at 5:16 AM, Forest Bond wrote: > Hi, > > Django allows an iterator to be passed as response content when instantiating > an > HttpResponse.  However, doing so causes problems with the following classes > and > functions: > > UpdateCacheMiddleware: >  Caches the response obje

Re: [RFC] Fixing middleware/view decorator handling of content iterators

2010-02-15 Thread Forest Bond
Hi, On Mon, Feb 15, 2010 at 03:27:27PM -0600, Jeremy Dunck wrote: > On Mon, Feb 15, 2010 at 3:16 PM, Forest Bond > wrote: > ... > > * Forbid premature draining of the content iterator via response.content by > > only > >  evaluating the content iterator if accessed via iter(response) and raisin

Re: [RFC] Fixing middleware/view decorator handling of content iterators

2010-02-15 Thread Jeremy Dunck
On Mon, Feb 15, 2010 at 3:16 PM, Forest Bond wrote: ... > * Forbid premature draining of the content iterator via response.content by > only >  evaluating the content iterator if accessed via iter(response) and raising an >  exception if it is accessed via response.content. ... > * Is this type o

[RFC] Fixing middleware/view decorator handling of content iterators

2010-02-15 Thread Forest Bond
Hi, Django allows an iterator to be passed as response content when instantiating an HttpResponse. However, doing so causes problems with the following classes and functions: UpdateCacheMiddleware: Caches the response object using the configured cache backend, but most iterators cannot be pi