register tag def head_include parser token nodelist parser parse endhe

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
@register.tag
def head_include(parser, token):
nodelist = parser.parse(('endhead_include',))
parser.delete_first_token()
return HeadBlock(nodelist)
class HeadBlock(template.Node):
def __init__(self, nodelist):
self.nodelist = nodelist
def render(self, context):
output = self.nodelist.render(context)
addcategory("header", "%s\n" % (output))
return None