Opened 18 months ago
Closed 18 months ago
#34541 closed New feature (wontfix)
StorageRouter
Reported by: | Vasanth | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
With the recent addition of STORAGES, would it be possible to have a StorageRouter that mimics the functionality of the DatabaseRouter but for files/storage classes?
Since the storage callable in Filefields are called during build, it cannot be used to dynamically set the storage class during runtime.
However dynamically setting the storage class would be particularly useful for cases where data for specific models needs to stored elsewhere or for SaaS backends provide independent and isolated buckets for each client/subdomain.
In case of fields that have a field level storage class and StorageRouter, priority has to be resolved by the router.
Related to #34540
Change History (3)
comment:1 by , 18 months ago
Description: | modified (diff) |
---|
comment:2 by , 18 months ago
Description: | modified (diff) |
---|
comment:3 by , 18 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
If you need such as advanced structure you can implement
settings.STORAGE
on your own as a subclass ofdict
.If you don't agree, please follow the triaging guidelines with regards to wontfix tickets and take this to DevelopersMailingList, where you'll reach a wider audience and see what other think.