utils.html.html_safe()

html_safe() [source]

The __html__() method on a class helps non-Django templates detect classes whose output doesn’t require HTML escaping.

This decorator defines the __html__() method on the decorated class by wrapping the __unicode__() (Python 2) or __str__() (Python 3) in mark_safe(). Ensure the __unicode__() or __str__() method does indeed return text that doesn’t require HTML escaping.

doc_Django
2016-10-09 18:40:30
Comments
Leave a Comment

Please login to continue.