Django

Code

Ticket #1994 (closed: duplicate)

Opened 4 years ago

Last modified 2 years ago

[patch] Custom upload_to per instance of FileField

Reported by: parlar@gmail.com Assigned to: nobody
Milestone: Component: Core framework
Version: Keywords: fs-rf-fixed
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

upload_to.diff (3.1 kB) - added by anonymous on 05/24/06 14:24:56.
db-api.diff (1.2 kB) - added by parlar@gmail.com on 05/25/06 10:53:49.
Documentation patch for the new keyword

Change History

05/24/06 14:24:56 changed by anonymous

  • attachment upload_to.diff added.

05/24/06 15:23:20 changed by parlar@gmail.com

  • component changed from Admin interface to Core framework.

Forgot to set the Component

05/25/06 10:53:49 changed by parlar@gmail.com

  • attachment db-api.diff added.

Documentation patch for the new keyword

05/28/06 21:46:42 changed by parlar@gmail.com

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.

02/11/07 20:52:25 changed by SmileyChris

  • stage changed from Unreviewed to Design decision needed.

02/11/07 21:14:18 changed by parlar@gmail.com

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.

09/16/07 07:40:17 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

Closing in favor of #5361.

12/16/07 14:56:35 changed by anonymous

  • keywords set to fs-rf.

07/29/08 14:55:59 changed by Gulopine

  • keywords changed from fs-rf to fs-rf-fixed.

Add/Change #1994 ([patch] Custom upload_to per instance of FileField)




Change Properties
Action