git.ithinksw.org
/
philo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'lapilofu/hotfix/manifest' into release
[philo.git]
/
philo
/
templatetags
/
include_string.py
diff --git
a/philo/templatetags/include_string.py
b/philo/templatetags/include_string.py
index
1de9ded
..
cb0a8b5
100644
(file)
--- a/
philo/templatetags/include_string.py
+++ b/
philo/templatetags/include_string.py
@@
-6,8
+6,6
@@
register = template.Library()
class IncludeStringNode(template.Node):
class IncludeStringNode(template.Node):
- """The passed variable is expected to be a string of template code to be rendered with
- the current context."""
def __init__(self, string):
self.string = string
def __init__(self, string):
self.string = string
@@
-23,9
+21,10
@@
class IncludeStringNode(template.Node):
return settings.TEMPLATE_STRING_IF_INVALID
return settings.TEMPLATE_STRING_IF_INVALID
-def do_include_string(parser, token):
+@register.tag
+def include_string(parser, token):
"""
"""
- Include a flat string by interpreting it as a template.
+ Include a flat string by interpreting it as a template.
The compiled template will be rendered with the current context.
Usage::
Usage::
@@
-36,7
+35,4
@@
def do_include_string(parser, token):
if len(bits) != 2:
raise TemplateSyntaxError("%r tag takes one argument: the template string to be included" % bits[0])
string = parser.compile_filter(bits[1])
if len(bits) != 2:
raise TemplateSyntaxError("%r tag takes one argument: the template string to be included" % bits[0])
string = parser.compile_filter(bits[1])
- return IncludeStringNode(string)
-
-
-register.tag('include_string', do_include_string)
\ No newline at end of file
+ return IncludeStringNode(string)
\ No newline at end of file