예제 #1
0
def mark_safe(s):
    from django.utils.safestring import mark_safe as django_safe
    if callable(s):
        @wraps(s)
        def wrapper(*args, **kwargs):
            return django_safe(*args, **kwargs)
        return wrapper
    return django_safe(s)
예제 #2
0
def mark_safe(s):
    from django.utils.safestring import mark_safe as django_safe
    if django.VERSION < (1, 11):

        def func_wrapper(html):
            return django_safe(s(html))

        return func_wrapper
    return django_safe(s)
예제 #3
0
def mark_safe(s):
    from django.utils.safestring import mark_safe as django_safe
    if callable(s):

        @wraps(s)
        def wrapper(*args, **kwargs):
            return django_safe(*args, **kwargs)

        return wrapper
    return django_safe(s)
예제 #4
0
def mark_safe(s):
    from django.utils.safestring import mark_safe as django_safe
    if isinstance(s, collections.Callable):

        @wraps(s)
        def wrapper(*args, **kwargs):
            return django_safe(*args, **kwargs)

        return wrapper
    return django_safe(s)
예제 #5
0
 def wrapper(*args, **kwargs):
     return django_safe(*args, **kwargs)
예제 #6
0
 def wrapper(*args, **kwargs):
     return django_safe(*args, **kwargs)
예제 #7
0
 def func_wrapper(html):
     return django_safe(s(html))