mirror of
https://github.com/django/django.git
synced 2025-09-21 18:00:45 +00:00
Removed truncate_words and truncate_html_words.
This commit is contained in:
parent
e00d1b6dc6
commit
9f9a4cdecd
2 changed files with 0 additions and 40 deletions
|
@ -209,20 +209,6 @@ class Truncator(SimpleLazyObject):
|
|||
# Return string
|
||||
return out
|
||||
|
||||
def truncate_words(s, num, end_text='...'):
|
||||
warnings.warn('This function has been deprecated. Use the Truncator class '
|
||||
'in django.utils.text instead.', category=DeprecationWarning)
|
||||
truncate = end_text and ' %s' % end_text or ''
|
||||
return Truncator(s).words(num, truncate=truncate)
|
||||
truncate_words = allow_lazy(truncate_words, six.text_type)
|
||||
|
||||
def truncate_html_words(s, num, end_text='...'):
|
||||
warnings.warn('This function has been deprecated. Use the Truncator class '
|
||||
'in django.utils.text instead.', category=DeprecationWarning)
|
||||
truncate = end_text and ' %s' % end_text or ''
|
||||
return Truncator(s).words(num, truncate=truncate, html=True)
|
||||
truncate_html_words = allow_lazy(truncate_html_words, six.text_type)
|
||||
|
||||
def get_valid_filename(s):
|
||||
"""
|
||||
Returns the given string converted to a string that can be used for a clean
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue