def overextends(parser, token):
    """
    Extended version of Django's ``extends`` tag that allows circular
    inheritance to occur, eg a template can both be overridden and
    extended at once.
    """
    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 OverExtendsNode(nodelist, parent_name, None)
def overextends ( 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 OverExtendsNode ( nodelist , parent_name , None )
Extended version of Django's ``extends`` tag that allows circular
    inheritance to occur, eg a template can both be overridden and
    extended at once.