Opened 17 years ago

Closed 17 years ago

#4113 closed (duplicate)

dynamic destinations for FileField.upload_to

Reported by: August Bigelow <wip@…> 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 Simon G. <dev@…>, 17 years ago

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

comment:2 by anonymous, 17 years ago

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

comment:3 by Øyvind Saltvik <oyvind@…>, 17 years ago

Try the latest #3297

comment:4 by Philippe Raoult, 17 years ago

Resolution: worksforme
Status: newclosed

duplicate of #5029

comment:5 by Philippe Raoult, 17 years ago

Resolution: worksforme
Status: closedreopened

comment:6 by Philippe Raoult, 17 years ago

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