Python django.utils.safestring.mark_for_escaping() Examples

The following are 5 code examples for showing how to use django.utils.safestring.mark_for_escaping(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module django.utils.safestring , or try the search function .

Example 1
Project: GTDWeb   Author: lanbing510   File: defaultfilters.py    License: GNU General Public License v2.0 5 votes vote down vote up
def escape_filter(value):
    """
    Marks the value as a string that should be auto-escaped.
    """
    return mark_for_escaping(value) 
Example 2
Project: python   Author: Yeah-Kun   File: defaultfilters.py    License: Apache License 2.0 5 votes vote down vote up
def escape_filter(value):
    """
    Marks the value as a string that should be auto-escaped.
    """
    with warnings.catch_warnings():
        # Ignore mark_for_escaping deprecation -- this will use
        # conditional_escape() in Django 2.0.
        warnings.simplefilter('ignore', category=RemovedInDjango20Warning)
        return mark_for_escaping(value) 
Example 3
Project: luscan-devel   Author: blackye   File: defaultfilters.py    License: GNU General Public License v2.0 5 votes vote down vote up
def escape_filter(value):
    """
    Marks the value as a string that should not be auto-escaped.
    """
    return mark_for_escaping(value) 
Example 4
Project: openhgsenti   Author: drexly   File: defaultfilters.py    License: Apache License 2.0 5 votes vote down vote up
def escape_filter(value):
    """
    Marks the value as a string that should be auto-escaped.
    """
    return mark_for_escaping(value) 
Example 5
Project: python2017   Author: bpgc-cte   File: defaultfilters.py    License: MIT License 5 votes vote down vote up
def escape_filter(value):
    """
    Marks the value as a string that should be auto-escaped.
    """
    with warnings.catch_warnings():
        # Ignore mark_for_escaping deprecation -- this will use
        # conditional_escape() in Django 2.0.
        warnings.simplefilter('ignore', category=RemovedInDjango20Warning)
        return mark_for_escaping(value)