Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #1834 -- Documented include_admin_script tag in admin interface.…

… Thanks to

Matias Hermanrud Fjeld.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3147 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c6dc7089a126ba59e712051a49af8d8c26653d3d 1 parent 271083c
Malcolm Tredinnick malcolmt authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 django/contrib/admin/templatetags/admin_modify.py
13 django/contrib/admin/templatetags/admin_modify.py
View
@@ -18,6 +18,19 @@ def class_name_to_underscored(name):
return '_'.join([s.lower() for s in word_re.findall(name)[:-1]])
def include_admin_script(script_path):
+ """
+ Returns an HTML script element for including a script from the admin
+ media url.
+
+ Example usage::
+
+ {% include_admin_script js/calendar.js %}
+
+ could return::
+
+ <script type="text/javascript" src="/media/admin/js/calendar.js">
+ """
+
return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path)
include_admin_script = register.simple_tag(include_admin_script)
Please sign in to comment.
Something went wrong with that request. Please try again.