dynamic destinations for FileField.upload_to
|Reported by:||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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 Changed 9 years ago by
|Patch needs improvement:||unset|
|Summary:||FileField.upload_to issues → dynamic destinations for FileField.upload_to|
|Triage Stage:||Unreviewed → Design decision needed|
|Version:||0.96 → SVN|