From c6dc7089a126ba59e712051a49af8d8c26653d3d Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 19 Jun 2006 12:35:38 +0000 Subject: [PATCH] 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 --- django/contrib/admin/templatetags/admin_modify.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index 9f646214ce..2d34452f52 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/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:: + + ' % (settings.ADMIN_MEDIA_PREFIX, script_path) include_admin_script = register.simple_tag(include_admin_script)