<s> from django . template import Library <EOL> from django . template . defaulttags import url as default_url , URLNode <EOL> from tenant_schemas . utils import clean_tenant_url <EOL> register = Library ( ) <EOL> class SchemaURLNode ( URLNode ) : <EOL> def __init__ ( self , url_node ) : <EOL> super ( SchemaURLNode , self ) . __init__ ( url_node . view_name , url_node . args , url_node . kwargs , url_node . asvar ) <EOL> def render ( self , context ) : <EOL> url = super ( SchemaURLNode , self ) . render ( context ) <EOL> return clean_tenant_url ( url ) <EOL> @ register . tag <EOL> def url ( parser , token ) : <EOL> return SchemaURLNode ( default_url ( parser , token ) ) </s>
