Re: Ticket #3297 and File uploads

2007-06-05 Thread Malcolm Tredinnick
On Mon, 2007-06-04 at 16:04 +1000, Malcolm Tredinnick wrote: > On Mon, 2007-06-04 at 12:44 +0800, Russell Keith-Magee wrote: > > Hi All, > > > > I've been looking at ticket #3297 - a request to implement FileField > > and ImageField in newforms. > > > > Adrian's comments on this ticket, plus the

Re: Ticket #3297 and File uploads

2007-06-04 Thread Malcolm Tredinnick
On Mon, 2007-06-04 at 13:58 +0200, David Danier wrote: > > Perhaps request.POST.copy() could do this translation/decoding? > > Shouldn't request.{POST,GET}.copy() return an decoded version anyway? They return an *exact* copy of the same data structure. So it has an encoding attribute and the dec

Re: Ticket #3297 and File uploads

2007-06-04 Thread Malcolm Tredinnick
On Mon, 2007-06-04 at 18:57 +0800, Russell Keith-Magee wrote: > On 6/4/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Mon, 2007-06-04 at 12:44 +0800, Russell Keith-Magee wrote: > > > Hi All, > > > > > > I've been looking at ticket #3297 - a request to implement FileField > > > and Im

Re: Ticket #3297 and File uploads

2007-06-04 Thread Malcolm Tredinnick
On Mon, 2007-06-04 at 13:37 +0200, David Danier wrote: > > So the Unicode branch does decoding when > > things in request.GET and request.POST are accessed, not on > > construction, and you can change the encoding to whatever you like via > > an attribute on the HttpRequest (or http.QueryDict) cla

Re: Ticket #3297 and File uploads

2007-06-04 Thread David Danier
> Perhaps request.POST.copy() could do this translation/decoding? Shouldn't request.{POST,GET}.copy() return an decoded version anyway? Otherwise the copy() might look different to the vars under request: post_copy = request.POST.copy() if post_copy['foo'] == request.POST['foo']: print '

Re: Ticket #3297 and File uploads

2007-06-04 Thread David Danier
> So the Unicode branch does decoding when > things in request.GET and request.POST are accessed, not on > construction, and you can change the encoding to whatever you like via > an attribute on the HttpRequest (or http.QueryDict) class. Perhaps request.POST.copy() could do this translation/deco

Re: Ticket #3297 and File uploads

2007-06-04 Thread Russell Keith-Magee
On 6/4/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2007-06-04 at 12:44 +0800, Russell Keith-Magee wrote: > > Hi All, > > > > I've been looking at ticket #3297 - a request to implement FileField > > and ImageField in newforms. ... > > If we then modify value_from_datadict to also

Re: Ticket #3297 and File uploads

2007-06-03 Thread Malcolm Tredinnick
On Mon, 2007-06-04 at 12:44 +0800, Russell Keith-Magee wrote: > Hi All, > > I've been looking at ticket #3297 - a request to implement FileField > and ImageField in newforms. > > Adrian's comments on this ticket, plus the code in newforms-admin seem > to suggest that the 'approved' technique for

Ticket #3297 and File uploads

2007-06-03 Thread Russell Keith-Magee
Hi All, I've been looking at ticket #3297 - a request to implement FileField and ImageField in newforms. Adrian's comments on this ticket, plus the code in newforms-admin seem to suggest that the 'approved' technique for handling file submission data is to use: new_data = request.POST.copy() ne