[Django] #35644: `AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in their `Media`

6 views
Skip to first unread message

Django

unread,
Jul 30, 2024, 8:42:49 PM7/30/24
to django-...@googlegroups.com
#35644: `AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media`
-------------------------------------+-------------------------------------
Reporter: Michał Pokusa | Type:
| Uncategorized
Status: new | Component: Forms
Version: 5.0 | Severity: Normal
Keywords: media, widgets, | Triage Stage:
admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
While developing an extension for Django I noticed that both
`AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media` nor do they inherit it from any parent class.

The `admin/js/core.js`, specifically the `quickElement` function is used
inside `admin/js/admin/DateTimeShortcuts.js`, which they both reference.

Usually, this is not an issue as `admin/js/core.js` is referenced in
`ModelAdmin.media`, **but nevertheless this seems like it was missed
rather than an intended way**. Other admin widget -
`FilteredSelectMultiple` - references `admin/js/core.js` together with
other scripts needed for it to work.

Wraping it up, I suggest adding `admin/js/core.js` to both
`AdminDateWidget` and `AdminTimeWidget` to unify them with
`FilteredSelectMultiple`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35644>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 31, 2024, 1:01:38 PM7/31/24
to django-...@googlegroups.com
#35644: `AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media`
-------------------------------------+-------------------------------------
Reporter: Michał Pokusa | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: media, widgets, | Triage Stage: Accepted
admin |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Matthias Kestenholz):

* component: Forms => contrib.admin
* stage: Unreviewed => Accepted
* type: Uncategorized => Bug

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

Django

unread,
Jul 31, 2024, 4:16:46 PM7/31/24
to django-...@googlegroups.com
#35644: `AdminDateWidget` and `AdminTimeWidget` do not have `admin/js/core.js` in
their `Media`
-------------------------------------+-------------------------------------
Reporter: Michał Pokusa | Owner: (none)
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution: duplicate
Keywords: media, widgets, | Triage Stage:
admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* resolution: => duplicate
* stage: Accepted => Unreviewed
* status: new => closed

Comment:

Thank you Michał for this report. This is a duplicate of #9576, though I'm
a little torn about the `wontfix` resolution from 15 years ago because the
main counterargument is, as you said in the description, that
`FilteredSelectMultiple` does include it explicitly.

Given the current Django triage process, I have to close this as a
`duplicate` of #9576, but if you feel strong about this, you could start a
new conversation on the [https://forum.djangoproject.com/c/internals/5
Django Forum], where you'll reach a wider audience and likely get extra
feedback. If there is a community agreement that this change is desired, I
will be happy to re-open #9576.
--
Ticket URL: <https://code.djangoproject.com/ticket/35644#comment:2>
Reply all
Reply to author
Forward
0 new messages