#34864: Add ability to customise script tags for form media
---------------------------------------+------------------------
               Reporter:  Tom Carrick  |          Owner:  nobody
                   Type:  New feature  |         Status:  new
              Component:  Forms        |        Version:  dev
               Severity:  Normal       |       Keywords:
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+------------------------
 It would be useful to be able to add `defer`, `integrity`,
 `type="module"`, etc. onto the script tags generated by form media.

 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.

-- 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018abc156448-73936fad-b53f-4740-96c7-87868ea9f552-000000%40eu-central-1.amazonses.com.

Reply via email to