Opened 18 years ago
Closed 17 years ago
#4113 closed (duplicate)
dynamic destinations for FileField.upload_to
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
From my experience, the current setup for the FileField and ImageField attribute "upload_to" is too inflexible. While save_FIELD_file is very quick and easy, telling the core where to put that file is not. I think giving another class contribution could make things much more flexible.
I believe usage akin to this would work sufficiently:
class TestModel(Model): file = FileField() some_number = 145 t = TestModel() t.set_file_upload_to("desired/path/%s/" % some_number)
Giving the programmer the ability to change the destination folder on the fly would allow for more dynamic destinations. You'd be able to use IDs from other objects and use them here.
Change History (6)
comment:1 by , 18 years ago
Summary: | FileField.upload_to issues → dynamic destinations for FileField.upload_to |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
Version: | 0.96 → SVN |
comment:2 by , 17 years ago
comment:5 by , 17 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
comment:6 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Any update on this feature? This capability would make my life a whole lot easier!