[Django] #35886: Move object-based media assets to the public API

17 views
Skip to first unread message

Django

unread,
Nov 4, 2024, 1:24:50 PM11/4/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Type:
| Cleanup/optimization
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
This is a successor to #29490 and a result of the discussion on #22298 and
[https://forum.djangoproject.com/t/rejuvenating-vs-deprecating-form-
media/21285 its corresponding forum thread].

This ticket aims to move object-based media assets to the public API and
documentation.
A sample implementation has been part of the test suite for years, see
also:
https://github.com/django/django/blob/97a6a678c406b0049bd17bcd34f1d71d96141994/tests/forms_tests/tests/test_media.py#L717-L771

The goal is to support form assets with modern attributes, like:

{{{
<script type="module">
<!-- or -->
<script defer>
<!-- or -->
<script async>
}}}

And other standardized attributes, see https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/script

The same can be done for stylesheets via the link tag, which does support
many more attributes than `media`, see also: https://developer.mozilla.org
/en-US/docs/Web/HTML/Element/link

**Considerations**

We could deprecate "string" based assets. This may simplify `django.forms`
since, the CSS grouping wouldn't be needed anymore.
--
Ticket URL: <https://code.djangoproject.com/ticket/35886>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 5, 2024, 2:50:41 AM11/5/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------
Reporter: Johannes Maron | Owner: (none)
Type: New feature | Status: new
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Sarah Boyce):

* cc: Tobias Kunze, David Smith (added)
* stage: Unreviewed => Accepted
* type: Cleanup/optimization => New feature

Comment:

Accepting based off the forum discussion
--
Ticket URL: <https://code.djangoproject.com/ticket/35886#comment:1>

Django

unread,
Nov 6, 2024, 4:21:46 AM11/6/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Johannes Maron):

* owner: (none) => Johannes Maron
* status: new => assigned

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

Django

unread,
Nov 7, 2024, 1:15:45 PM11/7/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Johannes Maron):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35886#comment:3>

Django

unread,
Nov 29, 2024, 6:18:13 AM11/29/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35886#comment:4>
Django <https://code.djangoproject.com/>
The web framework for perfectionists with deadlines.

Django

unread,
Nov 29, 2024, 8:14:31 AM11/29/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Johannes Maron):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35886#comment:5>

Django

unread,
Dec 3, 2024, 10:47:26 AM12/3/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Sarah Boyce):

* needs_tests: 0 => 1

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

Django

unread,
Dec 10, 2024, 5:09:37 AM12/10/24
to django-...@googlegroups.com
#35886: Move object-based media assets to the public API
--------------------------------+------------------------------------------
Reporter: Johannes Maron | Owner: Johannes Maron
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Johannes Maron):

* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35886#comment:7>
Reply all
Reply to author
Forward
0 new messages