Opened 10 years ago

Closed 9 years ago

#4113 closed (duplicate)

dynamic destinations for FileField.upload_to

Reported by: August Bigelow <wip@…> Owned by: nobody
Component: Core (Other) Version: master
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 Changed 10 years ago by Simon G. <dev@…>

Summary: FileField.upload_to issuesdynamic destinations for FileField.upload_to
Triage Stage: UnreviewedDesign decision needed
Version: 0.96SVN

comment:2 Changed 9 years ago by anonymous

Any update on this feature? This capability would make my life a whole lot easier!

comment:3 Changed 9 years ago by Øyvind Saltvik <oyvind@…>

Try the latest #3297

comment:4 Changed 9 years ago by Philippe Raoult

Resolution: worksforme
Status: newclosed

duplicate of #5029

comment:5 Changed 9 years ago by Philippe Raoult

Resolution: worksforme
Status: closedreopened

comment:6 Changed 9 years ago by Philippe Raoult

Resolution: duplicate
Status: reopenedclosed
Note: See TracTickets for help on using tickets.
Back to Top