mirror of
https://github.com/django/django.git
synced 2025-10-17 05:47:44 +00:00
Removed support is_safe and needs_autoescape as function attributes.
This commit is contained in:
parent
641acf76e7
commit
5d5e1f5afa
2 changed files with 0 additions and 29 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue