def load(parser, token): global new_style_url_tag bits = token.contents.split() reloaded_url_tag = False if len(bits) >= 4 and bits[-2] == "from" and bits[-1] == "future": for name in bits[1:-2]: if name == "url": new_style_url_tag = True reloaded_url_tag = True try: return defaulttags.load(parser, token) finally: if reloaded_url_tag: parser.tags['url'] = new_style_url
def load(parser, token): global new_style_url_tag bits = token.contents.split() reloaded_url_tag = False if len(bits) >= 4 and bits[-2] == "from" and bits[-1] == "future": for name in bits[1:-2]: if name == "url": if ONLY_NEW_STYLE_URL_TAGS: _error("url template tag are removed from the future template tag library as of Django 1.9") else: new_style_url_tag = True reloaded_url_tag = True try: return defaulttags.load(parser, token) finally: if reloaded_url_tag: parser.tags['url'] = new_style_url
def load(parser, token): global new_style_url_tag bits = token.contents.split() reloaded_url_tag = False if len(bits) >= 4 and bits[-2] == "from" and bits[-1] == "future": for name in bits[1:-2]: if name == "url": if ONLY_NEW_STYLE_URL_TAGS: _error( "url template tag are removed from the future template tag library as of Django 1.9" ) else: new_style_url_tag = True reloaded_url_tag = True try: return defaulttags.load(parser, token) finally: if reloaded_url_tag: parser.tags['url'] = new_style_url
def load(parser, token): decorating_parser = DecoratingParserProxy(parser) return defaulttags.load(decorating_parser, token)
def load(parser, token): # pragma: no cover decorating_parser = DecoratingParserProxy(parser) return defaulttags.load(decorating_parser, token)