It would be great to extend the same functionality to the upload_to
argument as well. In some projects, we do find ourselves manually
overriding it for every file & image field and it is one more check to
remember / check during PRs.
It would be great if we could define a DEFAULT_UPLOAD_TO =
"callable_or_string" so that it simplifies working on a project when
collaborating with others
--
Ticket URL: <https://code.djangoproject.com/ticket/35057>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> On the FileField, we have the option to define the default storage that
> the project uses globally with the option to override it at a field level
> manually.
>
> It would be great to extend the same functionality to the upload_to
> argument as well. In some projects, we do find ourselves manually
> overriding it for every file & image field and it is one more check to
> remember / check during PRs.
>
> It would be great if we could define a DEFAULT_UPLOAD_TO =
> "callable_or_string" so that it simplifies working on a project when
> collaborating with others
New description:
On the FileField, we have the option to define the default storage that
the project uses globally with the option to override it at a field level
manually.
It would be great to extend the same functionality to the upload_to
argument as well. In some projects, we do find ourselves manually
overriding it for every file & image field and it is one more check to
remember / check during PRs.
It would be great if we could define a DEFAULT_UPLOAD_TO =
"callable_or_string" so that it simplifies working on a project when
collaborating with others
I did it ask around the forum and was told having a custom field was the
only way to go at the moment (ref: https://forum.djangoproject.com/t
/settings-upload-to-at-project-level-settings/26334)
--
--
Ticket URL: <https://code.djangoproject.com/ticket/35057#comment:1>