#18455: Added hooks to Media for staticfiles app
-----------------------------+------------------------------------
Reporter: djw | Owner: nobody
Type: New feature | Status: new
Component: Forms | 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
-----------------------------+------------------------------------
Changes (by jezdez):
* type: Bug => New feature
* stage: Design decision needed => Accepted
Comment:
Using the staticfiles_storage in the Django core is a no-go. The
staticfiles app is a contrib app and should be considered optional.
You can however easily override that by providing an own Media class, as
documented. I suggest to add an own class to the staticfiles app so users
can use that in their form class.
Of course this implies that we first of all clean up the ``Media`` class
API in the forms library in the first place. E.g. renaming it to
``Static`` for example.
So to summarize I think this should be fixed by:
1. add a new ``Static`` class to the form library that has hooks to
implement different way to get the path of a file
2. add a ``Static`` subclass to staticfiles that users can import in their
forms modules to use the staticfiles app instead of just joining with
STATIC_URL
While you're there you should also think about extending the ``Static``
class to be more flexible with regard to multiple files etc.
This ticket obviously can only handle a few of those issues, so please
open new tickets for the other parts.
--
Ticket URL: <https://code.djangoproject.com/ticket/18455#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.