Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#5306 closed (fixed)

ImageField upload_to - New Web Forms

Reported by: danielrubio Owned by: nobody
Component: Forms Version: dev
Severity: Keywords: Image field upload_to, fs-rf
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Just trying out the forms.ImageField and noticed it did not allow me to pass in the parameter upload_to ( which typically goes in the model.ImageField).

Looked over django/newforms/ in SVN, and added :

  • upload_to=None as a parameter to the init function on the Field class (Line 51).

Seems to be working on the surface at least, still haven't verified the upload working though.

Change History (5)

comment:1 Changed 15 years ago by Philippe Raoult

Resolution: duplicate
Status: newclosed

will be solved by #5361.

comment:2 Changed 15 years ago by Marty Alchin

Keywords: fs-rf added

comment:3 Changed 14 years ago by Loststylus

Resolution: duplicate
Status: closedreopened

Still having trouble here. Django 1.0.2, forms.ImageField doesn't accept upload_to and uploading doesn't work.

comment:4 Changed 14 years ago by Malcolm Tredinnick

Resolution: fixed
Status: reopenedclosed

The form field wouldn't be expected to take an upload_to parameter, since forms, by default, don't save any data. That's up to either the view function or, more typically, the model. So model fields take upload_to.

Form file fields are, per se, broken, since, for example, they work in the admin. So you might wish to post some details about your situation on django-users or #django to get some help to clarify the situation. If there really is a problem here, please open a new ticket, since this ticket was about something that has already been fixed (it's not clear that it was a bug in the first place, since, again, normal forms aren't responsible for saving data).

comment:5 in reply to:  4 Changed 14 years ago by Karen Tracey

Replying to mtredinnick:

Form file fields are, per se, broken, ...

Just to clarify, this is missing an important 'not'. Form file fields are not, per se, broken, since they work in admin, etc.

Note: See TracTickets for help on using tickets.
Back to Top