Opened 19 years ago

Closed 17 years ago

Last modified 16 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

Description

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 19 years ago.
db-api.diff (1.2 KB ) - added by parlar@… 19 years ago.
Documentation patch for the new keyword

Download all attachments as: .zip

Change History (9)

by anonymous, 19 years ago

Attachment: upload_to.diff added

comment:1 by parlar@…, 19 years ago

Component: Admin interfaceCore framework

Forgot to set the Component

by parlar@…, 19 years ago

Attachment: db-api.diff added

Documentation patch for the new keyword

comment:2 by parlar@…, 18 years ago

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 by Chris Beaven, 18 years ago

Triage Stage: UnreviewedDesign decision needed

comment:4 by parlar@…, 18 years ago

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 by James Bennett, 17 years ago

Resolution: duplicate
Status: newclosed

Closing in favor of #5361.

comment:6 by anonymous, 17 years ago

Keywords: fs-rf added

comment:7 by Marty Alchin, 16 years ago

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