[Django] #33241: support for script type="module" in django admin Form Media

57 views
Skip to first unread message

Django

unread,
Oct 29, 2021, 10:21:06 AM10/29/21
to django-...@googlegroups.com
#33241: support for script type="module" in django admin Form Media
-------------------------------------------+------------------------
Reporter: Thomas Grainger | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
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 |
-------------------------------------------+------------------------
I'd like to be able to add ESM modules to my Forms and Widgets eg:


{{{

@attr.frozen
class JS:
type: Literal["application/json", "module"] = "application/json"
src: str

@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):

class Media:
js = (JS(type="module", src='js/my_script.js'),)

}}}


see also https://stackoverflow.com/questions/56232944/how-to-add-script-
type-module-in-django-admin

--
Ticket URL: <https://code.djangoproject.com/ticket/33241>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 29, 2021, 1:01:21 PM10/29/21
to django-...@googlegroups.com
#33241: support for script type="module" in django admin Form Media
---------------------------------+--------------------------------------

Reporter: Thomas Grainger | Owner: nobody
Type: New feature | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* type: Uncategorized => New feature
* component: Uncategorized => contrib.admin


Comment:

The Django admin doesn't use ESM modules, so far as I'm aware we can close
is as a duplicate of more general ticket #9357.

--
Ticket URL: <https://code.djangoproject.com/ticket/33241#comment:1>

Django

unread,
Oct 30, 2021, 5:55:55 AM10/30/21
to django-...@googlegroups.com
#33241: support for script type="module" in django admin Form Media
---------------------------------+--------------------------------------

Reporter: Thomas Grainger | Owner: nobody
Type: New feature | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


--
Ticket URL: <https://code.djangoproject.com/ticket/33241#comment:2>

Reply all
Reply to author
Forward
0 new messages