Permalink
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...
1 parent 271083c commit c6dc7089a126ba59e712051a49af8d8c26653d3d @malcolmt malcolmt committed Jun 19, 2006
Showing with 13 additions and 0 deletions.
  1. +13 −0 django/contrib/admin/templatetags/admin_modify.py
@@ -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)

0 comments on commit c6dc708

Please sign in to comment.