> 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
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
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
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
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')
5 matches
Mail list logo