Loading django/template/defaultfilters.py +0 −9 Original line number Diff line number Diff line Loading @@ -49,15 +49,6 @@ def stringfilter(func): # when multiple decorators are applied). _dec._decorated_function = getattr(func, '_decorated_function', func) for attr in ('is_safe', 'needs_autoescape'): if hasattr(func, attr): import warnings warnings.warn("Setting the %s attribute of a template filter " "function is deprecated; use @register.filter(%s=%s) " "instead" % (attr, attr, getattr(func, attr)), DeprecationWarning) setattr(_dec, attr, getattr(func, attr)) return wraps(func)(_dec) Loading docs/howto/custom-template-tags.txt +0 −20 Original line number Diff line number Diff line Loading @@ -328,26 +328,6 @@ Template filter code falls into one of two situations: handle the auto-escaping issues and return a safe string, the ``is_safe`` flag won't change anything either way. .. versionchanged:: 1.4 ``is_safe`` and ``needs_autoescape`` used to be attributes of the filter function; this syntax is deprecated. .. code-block:: python @register.filter def myfilter(value): return value myfilter.is_safe = True .. code-block:: python @register.filter def initial_letter_filter(text, autoescape=None): # ... return mark_safe(result) initial_letter_filter.needs_autoescape = True .. _filters-timezones: Filters and time zones Loading Loading
django/template/defaultfilters.py +0 −9 Original line number Diff line number Diff line Loading @@ -49,15 +49,6 @@ def stringfilter(func): # when multiple decorators are applied). _dec._decorated_function = getattr(func, '_decorated_function', func) for attr in ('is_safe', 'needs_autoescape'): if hasattr(func, attr): import warnings warnings.warn("Setting the %s attribute of a template filter " "function is deprecated; use @register.filter(%s=%s) " "instead" % (attr, attr, getattr(func, attr)), DeprecationWarning) setattr(_dec, attr, getattr(func, attr)) return wraps(func)(_dec) Loading
docs/howto/custom-template-tags.txt +0 −20 Original line number Diff line number Diff line Loading @@ -328,26 +328,6 @@ Template filter code falls into one of two situations: handle the auto-escaping issues and return a safe string, the ``is_safe`` flag won't change anything either way. .. versionchanged:: 1.4 ``is_safe`` and ``needs_autoescape`` used to be attributes of the filter function; this syntax is deprecated. .. code-block:: python @register.filter def myfilter(value): return value myfilter.is_safe = True .. code-block:: python @register.filter def initial_letter_filter(text, autoescape=None): # ... return mark_safe(result) initial_letter_filter.needs_autoescape = True .. _filters-timezones: Filters and time zones Loading