本文整理匯總了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)