diff options
| author | Tim Graham <timograham@gmail.com> | 2019-02-05 09:38:29 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-06 14:12:06 -0500 |
| commit | 77d25dbd0f20d6a907c805ffae8aaadd87edbacf (patch) | |
| tree | a082b53101084fb57bbd8d0fb69a3663e4e70057 /docs | |
| parent | d55e88292723764a16f0689c73bc7e739dfa6047 (diff) | |
Refs #27753 -- Favored SafeString over SafeText.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/custom-template-tags.txt | 6 | ||||
| -rw-r--r-- | docs/ref/utils.txt | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt index aa61b912b4..f39dc586d3 100644 --- a/docs/howto/custom-template-tags.txt +++ b/docs/howto/custom-template-tags.txt @@ -200,12 +200,12 @@ passed around inside the template code: to be interpreted as-is on the client side. Internally, these strings are of type - :class:`~django.utils.safestring.SafeText`. You can test for them + :class:`~django.utils.safestring.SafeString`. You can test for them using code like:: - from django.utils.safestring import SafeText + from django.utils.safestring import SafeString - if isinstance(value, SafeText): + if isinstance(value, SafeString): # Do something with the "safe" string. ... diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 9621db525b..0461cf6c11 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -748,14 +748,8 @@ appropriate entities. .. class:: SafeString - A ``str`` subclass that has been specifically marked as "safe" - (requires no further escaping) for HTML output purposes. Alias of - :class:`SafeText`. - -.. class:: SafeText - - A ``str`` subclass that has been specifically marked as "safe" for HTML - output purposes. + A ``str`` subclass that has been specifically marked as "safe" (requires no + further escaping) for HTML output purposes. .. function:: mark_safe(s) @@ -774,7 +768,7 @@ appropriate entities. >>> mystr = '<b>Hello World</b> ' >>> mystr = mark_safe(mystr) >>> type(mystr) - <class 'django.utils.safestring.SafeText'> + <class 'django.utils.safestring.SafeString'> >>> mystr = mystr.strip() # removing whitespace >>> type(mystr) |
