@register.tag('extends')
def do_extends(parser, token):
 bits = token.split_contents()
 if (len(bits) != 2):
  raise TemplateSyntaxError(("'%s' takes one argument" % bits[0]))
 parent_name = parser.compile_filter(bits[1])
 nodelist = parser.parse()
 if nodelist.get_nodes_by_type(ExtendsNode):
  raise TemplateSyntaxError(("'%s' cannot appear more than once in the same template" % bits[0]))
 return ExtendsNode(nodelist, parent_name)

@ register . tag ( 'extends' ) def do_extends ( parser , token ) : bits = token . split_contents ( ) if ( len ( bits ) != 2 ) : raise TemplateSyntaxError ( ( "'%s' takes one argument" % bits [ 0 ] ) ) parent_name = parser . compile_filter ( bits [ 1 ] ) nodelist = parser . parse ( ) if nodelist . get_nodes_by_type ( ExtendsNode ) : raise TemplateSyntaxError ( ( "'%s' cannot appear more than once in the same template" % bits [ 0 ] ) ) return ExtendsNode ( nodelist , parent_name )
signal that this template extends a parent template .