#5243: Bug in {% load %}
---------------------------------------------+------------------------------
Reporter: Bjørn Stabell <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: Template system
Version: SVN | Keywords: load
Stage: Unreviewed | Has_patch: 0
---------------------------------------------+------------------------------
According to {% load %} you can load templatetags that are in
subdirectories, e.g. {% load news.blah %}. This didn't work for me; I
kept getting errors.
Applying the below patch seems to work. I don't know why
{{{taglib.split('.')[-1])}}} was done in the first place? It's been like
this for as far back as I could trace the revisions in on this Trac. A
related ticket might be #372.
Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py (revision 8271)
+++ django/template/defaulttags.py (working copy)
@@ -792,7 +792,7 @@
for taglib in bits[1:]:
# add the library to the parser
try:
- lib = get_library("django.templatetags.%s" %
taglib.split('.')[-1])
+ lib = get_library("django.templatetags.%s" % taglib)
parser.add_library(lib)
except InvalidTemplateLibrary, e:
raise TemplateSyntaxError, "'%s' is not a valid tag library:
%s" % (taglib, e)
--
Ticket URL: <http://code.djangoproject.com/ticket/5243>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---