コード例 #1
0
ファイル: ojii_tags.py プロジェクト: ojii/ojii
def sanecycle(*args, **kwargs):
    """
    {% cycle 1 2 3 a myvar %} => ""
    {{ myvar }} => 1
    {{ myvar }} => 2
    {{ myvar }} => 3
    {{ myvar }} => 1
    """
    realnode = cycle(*args, **kwargs)
    return SaneCycleNode(realnode)
コード例 #2
0
def cycle(parser, token):
    """
    This is the future version of `cycle` with auto-escaping.

    By default all strings are escaped.

    If you want to disable auto-escaping of variables you can use:

        {% autoescape off %}
            {% cycle var1 var2 var3 as somecycle %}
        {% autoescape %}

    Or if only some variables should be escaped, you can use:

        {% cycle var1 var2|safe var3|safe  as somecycle %}
    """
    return defaulttags.cycle(parser, token, escape=True)
コード例 #3
0
ファイル: future.py プロジェクト: JJinx/django
def cycle(parser, token):
    """
    This is the future version of `cycle` with auto-escaping.
    The deprecation is now complete and this version is no different
    from the non-future version so this can be deprecated (#22306)

    By default all strings are escaped.

    If you want to disable auto-escaping of variables you can use::

        {% autoescape off %}
            {% cycle var1 var2 var3 as somecycle %}
        {% autoescape %}

    Or if only some variables should be escaped, you can use::

        {% cycle var1 var2|safe var3|safe  as somecycle %}
    """
    return defaulttags.cycle(parser, token)
コード例 #4
0
def cycle(parser, token):
    """
    This is the future version of `cycle` with auto-escaping.
    The deprecation is now complete and this version is no different
    from the non-future version so this is deprecated.

    By default all strings are escaped.

    If you want to disable auto-escaping of variables you can use::

        {% autoescape off %}
            {% cycle var1 var2 var3 as somecycle %}
        {% autoescape %}

    Or if only some variables should be escaped, you can use::

        {% cycle var1 var2|safe var3|safe  as somecycle %}
    """
    return defaulttags.cycle(parser, token)
コード例 #5
0
ファイル: future.py プロジェクト: 1check1/my-first-blog
def cycle(parser, token):
    """
    This is the future version of `cycle` with auto-escaping.
    The deprecation is now complete and this version is no different
    from the non-future version so this is deprecated.

    By default all strings are escaped.

    If you want to disable auto-escaping of variables you can use::

        {% autoescape off %}
            {% cycle var1 var2 var3 as somecycle %}
        {% autoescape %}

    Or if only some variables should be escaped, you can use::

        {% cycle var1 var2|safe var3|safe  as somecycle %}
    """
    warnings.warn(
        "Loading the `cycle` tag from the `future` library is deprecated and "
        "will be removed in Django 2.0. Use the default `cycle` tag instead.",
        RemovedInDjango20Warning)
    return defaulttags.cycle(parser, token)
コード例 #6
0
ファイル: future.py プロジェクト: 571451370/devstack_mitaka
def cycle(parser, token):
    """
    This is the future version of `cycle` with auto-escaping.
    The deprecation is now complete and this version is no different
    from the non-future version so this is deprecated.

    By default all strings are escaped.

    If you want to disable auto-escaping of variables you can use::

        {% autoescape off %}
            {% cycle var1 var2 var3 as somecycle %}
        {% autoescape %}

    Or if only some variables should be escaped, you can use::

        {% cycle var1 var2|safe var3|safe  as somecycle %}
    """
    warnings.warn(
        "Loading the `cycle` tag from the `future` library is deprecated and "
        "will be removed in Django 1.10. Use the default `cycle` tag instead.",
        RemovedInDjango110Warning)
    return defaulttags.cycle(parser, token)
コード例 #7
0
import warnings
コード例 #8
0
ファイル: compat.py プロジェクト: getpatchwork/patchwork
def cycle(parser, token):
    if django.VERSION < (1, 8):
        return defaulttags.cycle(parser, token, escape=True)
    else:
        return defaulttags.cycle(parser, token)
コード例 #9
0
ファイル: compat.py プロジェクト: seanfarley/patchwork
def cycle(parser, token):
    if django.VERSION < (1, 8):
        return defaulttags.cycle(parser, token, escape=True)
    else:
        return defaulttags.cycle(parser, token)