Opened 8 years ago

Closed 8 years ago

Last modified 5 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 Wayne K. Werner 8 years ago.
add core.js to admin date/time widgets

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Wayne K. Werner

Attachment: widgets.diff added

add core.js to admin date/time widgets

comment:1 Changed 8 years ago by Wayne K. Werner

Has patch: set

comment:2 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Jacob

Resolution: wontfix
Status: newclosed

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

comment:4 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top