Ticket #914: absolute_include_admin_script-r4185.diff
File absolute_include_admin_script-r4185.diff, 1.1 KB (added by , 18 years ago) |
---|
-
django/contrib/admin/templatetags/admin_modify.py
7 7 from django.db.models.related import BoundRelatedObject 8 8 from django.conf import settings 9 9 import re 10 from urlparse import urljoin 10 11 11 12 register = template.Library() 12 13 … … 27 28 could return:: 28 29 29 30 <script type="text/javascript" src="/media/admin/js/calendar.js"> 31 32 or (if you use an absolute path):: 33 34 {% include_admin_script /myjs/other.js %} 35 36 could return:: 37 38 <script type="text/javascript" src="/myjs/other.js"> 30 39 """ 31 40 32 return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path) 41 return '<script type="text/javascript" src="%s"></script>' \ 42 % urljoin(settings.ADMIN_MEDIA_PREFIX, script_path) 33 43 include_admin_script = register.simple_tag(include_admin_script) 34 44 35 45 def submit_row(context):