html_safe
A decorator that defines the html method. This helps non-Django templates to detect classes whose str methods return SafeString.
def html_safe(
klass: class
) - > class
A decorator that defines the html method. This helps non-Django templates to detect classes whose str methods return SafeString.
Parameters
| Name | Type | Description |
|---|---|---|
| klass | class | The class to be decorated, which must implement str but not html |
Returns
| Type | Description |
|---|---|
class | The modified class with html implemented and str wrapped to return a SafeString |