コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
def load(parser, token):
    decorating_parser = DecoratingParserProxy(parser)
    return defaulttags.load(decorating_parser, token)
コード例 #5
0
ファイル: templates.py プロジェクト: Folcon/django-speedbar
def load(parser, token):
    decorating_parser = DecoratingParserProxy(parser)
    return defaulttags.load(decorating_parser, token)
コード例 #6
0
def load(parser, token):  # pragma: no cover
    decorating_parser = DecoratingParserProxy(parser)
    return defaulttags.load(decorating_parser, token)