Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#9576 closed (wontfix)

django.contrib.admin.widgets.AdminDateWidget.Media.js missing core.js

Reported by: eddymul Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Steps To Reproduce:

from django.contrib import admin
w = admin.widgets.AdminDateWidget()
w.media.render_js()

Expected:
got js/core.js:

[u'<script type="text/javascript" src="/media/js/core.js"></script>',
 u'<script type="text/javascript" src="/media/js/calendar.js"></script>',
 u'<script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js"></script>']

Observed:
missing js/core.js:

[u'<script type="text/javascript" src="/media/js/calendar.js"></script>',
 u'<script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js"></script>']

Notes:
I tried

class MyForm(forms.Form):
  class Media:
    js = (settings.ADMIN_MEDIA_PREFIX + 'js/core.js',)

but it doesn't work because core.js is rendered last, but AdminDateWidget.media.js assumes that core.js has been evaluated.

Attachments (1)

widgets.diff (954 bytes) - added by AmanKow 5 years ago.
add core.js to admin date/time widgets

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by AmanKow

add core.js to admin date/time widgets

comment:1 Changed 5 years ago by AmanKow

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to closed

core.js gets included by ModelAdmin._media() (see django/contrib/admin/options.py around line 253).

comment:4 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.