#26029: Provide an API to configure arbitrary file storage backends
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: New feature | Status: new
Component: File uploads/storage | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by kezabelle):
For what it's worth, bmispelon and I discussed something akin to this
recently, out of which I started implementing something similar
[https://github.com/kezabelle/django-storagecellar entirely as an
experiment]. One thing I liked about where I went with that was that a
named storage key in the dictionary was a dotted path, and behaved
somewhat like a logging config in that the nearest 'parent' match such
that each model field which uses a storage could be addressed separately,
like so:
{{{
class Test(Model):
a = FileField(storage='myapp.test.a')
b = ImageField(storage='myapp.test.b')
}}}
and then if `myapp.test.a` or `myapp.test.b` were in the configuration
dictionary, they would be used, but if not, and `myapp.test` was, that
would be used, and so on walking backwards up the dotted path (falling
back to ostensibly `default` [`''`] in the end)
The notion there was third-party apps could namespacing storages per-
field, but at a project level one only has to opt-in as much as one cares
(ie: `myapp`, or `myapp.test`, or `default` etc.) to have finegrained
control.
--
Ticket URL: <https://code.djangoproject.com/ticket/26029#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.98aa46a9fc079510586e7251e0acb5fb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.