Re: No request.FILES, but file is still uploaded?

2008-05-09 Thread Beals
> Does your model have a FileField? Thanks, Karen. Yes, my model has a FileField. The doc never says explicitly that it the save will happen, which was the source of my confusion. It appears that it does when you have a FileField (I dove into the newforms code a bit and am partially convinced

Re: No request.FILES, but file is still uploaded?

2008-05-09 Thread [EMAIL PROTECTED]
I don't think this matters here, but you're overriding the 'file' builtin. On May 8, 7:03 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, May 8, 2008 at 3:51 PM, Beals <[EMAIL PROTECTED]> wrote: > > Correction: request.FILES does exist -- it just wasn't getting printed > > out with

Re: No request.FILES, but file is still uploaded?

2008-05-08 Thread Karen Tracey
On Thu, May 8, 2008 at 3:51 PM, Beals <[EMAIL PROTECTED]> wrote: > Correction: request.FILES does exist -- it just wasn't getting printed > out with "print request". An explicit "print request.FILES" did the > trick. > > However, my question still stands: is form.save(commit=False) supposed > to

Re: No request.FILES, but file is still uploaded?

2008-05-08 Thread Beals
Correction: request.FILES does exist -- it just wasn't getting printed out with "print request". An explicit "print request.FILES" did the trick. However, my question still stands: is form.save(commit=False) supposed to be writing the file out to disk? Is this the newforms way of handling

No request.FILES, but file is still uploaded?

2008-05-08 Thread Beals
A while back, I looked for code snippets for uploading files. Almost every site I found contained something like the following: if 'file' in request.FILES: file = request.FILES['file'] filename = file['filename'] fd = open('%s/%s' % (MEDIA_ROOT, filename), 'wb')