#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 |
Description
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/fields.py 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 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
Keywords: | fs-rf added |
---|
comment:3 by , 16 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Still having trouble here. Django 1.0.2, forms.ImageField doesn't accept upload_to and uploading doesn't work.
follow-up: 5 comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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 by , 16 years ago
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.
will be solved by #5361.