Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Converted django.contrib.admin.templatetags.adminmedia to use simple_…

…tag decorator

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 16da4e69c40d5926087c87c6084c375860c108f6 1 parent c5e5c0f
@adrianholovaty adrianholovaty authored
Showing with 8 additions and 16 deletions.
  1. +8 −16 django/contrib/admin/templatetags/adminmedia.py
View
24 django/contrib/admin/templatetags/adminmedia.py
@@ -1,17 +1,9 @@
-from django.core import template
+from django.core.template.decorators import simple_tag
-class AdminMediaPrefixNode(template.Node):
- def render(self, context):
- try:
- from django.conf.settings import ADMIN_MEDIA_PREFIX
- except ImportError:
- return ''
- return ADMIN_MEDIA_PREFIX
-
-def admin_media_prefix(parser, token):
- """
- {% admin_media_prefix %}
- """
- return AdminMediaPrefixNode()
-
-template.register_tag('admin_media_prefix', admin_media_prefix)
+def admin_media_prefix():
+ try:
+ from django.conf.settings import ADMIN_MEDIA_PREFIX
+ except ImportError:
+ return ''
+ return ADMIN_MEDIA_PREFIX
+admin_media_prefix = simple_tag(admin_media_prefix)
Please sign in to comment.
Something went wrong with that request. Please try again.