django filefield issue

457 Views Asked by At

filefield works just fine in the admin, but in a template nothing is uploaded upon submit. the form comes back with a "required" error for the filefield.

the paths seem to be right, and if they weren't, I don't think filefield would be working in the admin.

spent hours on this and I'm stumped. I'm using trunk. Ideas?

1

There are 1 best solutions below

0
On

http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files

Got it. I wasn't sending in request.FILES to the modelform constructor.

The django model reference for filefield doesn't mention special consideration for binding uploaded files to a form, but then again, I'm a total noob. Hopefully this helps someone else!