Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#1994 closed enhancement (duplicate)

[patch] Custom upload_to per instance of FileField

Reported by: parlar@… Owned by: nobody
Component: Core (Other) Version:
Severity: normal Keywords: fs-rf-fixed
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I find myself constantly limited by the upload_to field for FileField. Namely, I often want to specify different upload_to directories on an individual basis, not just wanting to dump all files into one directory, or use the strftime.

This patch addresses that by adding an optional keyword argument 'upload_to' to the save_XXX_file method.

Attachments (2)

upload_to.diff (3.1 KB) - added by anonymous 13 years ago.
db-api.diff (1.2 KB) - added by parlar@… 13 years ago.
Documentation patch for the new keyword

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by anonymous

Attachment: upload_to.diff added

comment:1 Changed 13 years ago by parlar@…

Component: Admin interfaceCore framework

Forgot to set the Component

Changed 13 years ago by parlar@…

Attachment: db-api.diff added

Documentation patch for the new keyword

comment:2 Changed 13 years ago by parlar@…

Just wanted to also note that this patch is 100% backwards compatible. If you choose not to use the new keyword when manually calling the save_XXX_file method, then the behaviour will be the same as it is now.

comment:3 Changed 12 years ago by Chris Beaven

Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 12 years ago by parlar@…

Well, I wrote this patch a *long* time ago. I don't know if it's still the best way to do it, but I do believe that FileField needs *some* kind of easy way to do custom directories.

comment:5 Changed 12 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Closing in favor of #5361.

comment:6 Changed 11 years ago by anonymous

Keywords: fs-rf added

comment:7 Changed 11 years ago by Marty Alchin

Keywords: fs-rf-fixed added; fs-rf removed
Note: See TracTickets for help on using tickets.
Back to Top