Hi Mike --
*Very* well done -- I'm in agreement with nearly every aspect of your
proposal. Major props for taking on such a sticky issue -- walking
into #2070 is a bit like exploring an overgrown jungle :) A few
comments inline below, but in general I quite like your API and would
like to see your code.
On Tue, Mar 18, 2008 at 11:30 PM, Mike Axiak <
mcaxiak@...> wrote:
> request.set_upload_handler(<upload_handler>)
I especially like this -- it neatly encapsulates the fact that
different folks are going to want quite different file upload
behavior. A few things to think about:
* Do you think it's worth firing a signal
(file_upload_started/file_upload_finished) from request or from the
base upload handler? This would let decentralized processing of file
uploads, but could get confusing.
* Do you think we should allow multiple upload handlers (which makes
this call into something like request.add_upload_handler(handler))?
The other option would be to just make folks compose upload handlers
with a wrapper class, which is hardly a hardship.
I don't have answers to either of these questions; something to think
about, at least.
> request.FILES
> -----------------
> This is no longer a MultiValueDict of raw content, but a
> MultiValueDict of UploadedFile objects.
> This will probably hurt the most, as there are probably applications
> assuming that they can take the content from this dict.
It seems to me that you could pretty easily provide a
backwards-compatible API by defining __getitem__ on UploadedFile;
raise a DeprecationWarning there but provide the data in the "old"
style.
> 5. get_chunk_size() -
Just make this FileUploadHandler.chunk_size -- no reason for getters/setters.
Again, thanks -- this is good stuff.
Jacob
--~--~---------~--~----~------------~-------~--~----~
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@...
To unsubscribe from this group, send email to
django-developers-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en-~----------~----~----~----~------~----~------~--~---