本文整理汇总了Python中django.utils.safestring.mark_for_escaping方法的典型用法代码示例。如果您正苦于以下问题:Python safestring.mark_for_escaping方法的具体用法?Python safestring.mark_for_escaping怎么用?Python safestring.mark_for_escaping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.utils.safestring
的用法示例。
在下文中一共展示了safestring.mark_for_escaping方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: escape_filter
# 需要导入模块: from django.utils import safestring [as 别名]
# 或者: from django.utils.safestring import mark_for_escaping [as 别名]
def escape_filter(value):
"""
Marks the value as a string that should be auto-escaped.
"""
return mark_for_escaping(value)
示例2: escape_filter
# 需要导入模块: from django.utils import safestring [as 别名]
# 或者: from django.utils.safestring import mark_for_escaping [as 别名]
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)
示例3: escape_filter
# 需要导入模块: from django.utils import safestring [as 别名]
# 或者: from django.utils.safestring import mark_for_escaping [as 别名]
def escape_filter(value):
"""
Marks the value as a string that should not be auto-escaped.
"""
return mark_for_escaping(value)