I couldn't find a way to do this currently. Perhaps something like this:
{{{
class MyForm(forms.Form):
class Media:
js = [
{"src": "js/foo.js", "defer": True, "type": "module"},
"js/bar.js",
]
}}}
Not sure if we should allow arbitrary stuff to be added or just choose the
options that are reasonable
--
Ticket URL: <https://code.djangoproject.com/ticket/34864>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Comment:
I think it's possible since 4c76ffc2d6c77c850b4bef8d9acc197d11c47937 by
using a class instead of paths, check out an
[https://github.com/django/django/blob/4de31ec680df062e5964b630f1b881ead5004e15/tests/forms_tests/tests/test_media.py#L761-L771
example] for `integrity`. Duplicate of #29490.
--
Ticket URL: <https://code.djangoproject.com/ticket/34864#comment:1>