[Django] #33302: Make the element_id argument of json_script optional

18 views
Skip to first unread message

Django

unread,
Nov 19, 2021, 10:56:55 AM11/19/21
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
---------------------------------------------+--------------------------
Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: assigned
Component: Template system | 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 recently had a use-case where I wanted to use `json_script` but I didn't
need any `id` for it (I was including the `<script>` inside a `<template>`
so I didn't need an `id` to refer to it).

I can't see any reason (security or otherwise) for the `id` to be required
and making it optional doesn't seem to break any tests.

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

Django

unread,
Nov 19, 2021, 10:58:39 AM11/19/21
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
-----------------------------------+--------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: assigned
Component: Template system | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Baptiste Mispelon):

* cc: Baptiste Mispelon (added)
* has_patch: 0 => 1


Comment:

PR is here: https://github.com/django/django/pull/15103

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

Django

unread,
Nov 20, 2021, 3:44:53 AM11/20/21
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
-----------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: New feature | Status: assigned
Component: Template system | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

Seems reasonable yes. Thanks.

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

Django

unread,
Nov 22, 2021, 3:29:23 AM11/22/21
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Baptiste
| Mispelon

Type: New feature | Status: assigned
Component: Template system | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Baptiste Mispelon
* stage: Accepted => Ready for checkin


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

Django

unread,
Nov 22, 2021, 6:33:57 AM11/22/21
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Baptiste
| Mispelon
Type: New feature | Status: closed

Component: Template system | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e6e664a71130ee74d2c4c6800e4131f132709997" e6e664a7]:
{{{
#!CommitTicketReference repository=""
revision="e6e664a71130ee74d2c4c6800e4131f132709997"
Fixed #33302 -- Made element_id optional argument for json_script template
filter.

Added versionchanged note in documentation
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33302#comment:4>

Django

unread,
Jan 28, 2022, 11:58:19 AM1/28/22
to django-...@googlegroups.com
#33302: Make the element_id argument of json_script optional
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Baptiste
| Mispelon
Type: New feature | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Johnson):

Just wanna say thanks for the feature. I just had the same thought and
wrote #33469 before finding it has already been done!

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

Reply all
Reply to author
Forward
0 new messages