diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-10-31 09:10:25 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-10-31 09:10:25 +0000 |
| commit | 422f6e8e174b187a1224c49ca72e63193f08e081 (patch) | |
| tree | b557ee4abedd0a47588d27cee42a588c74f75c46 /docs | |
| parent | 576e681302263c1ad0abe07b35c40b9cc4a343f1 (diff) | |
Mentionned changes from r17056 in the release notes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.4.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt index 6fb6f183cb..254e85197d 100644 --- a/docs/releases/1.4.txt +++ b/docs/releases/1.4.txt @@ -854,3 +854,26 @@ calls ``setup_environ``, which is now deprecated. ``execute_manager`` is also deprecated; ``execute_from_command_line`` can be used instead. (Neither of these functions is documented public API, but a deprecation path is needed due to use in existing ``manage.py`` files.) + +``is_safe`` and ``needs_autoescape`` attributes of template filters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Two flags, ``is_safe`` and ``needs_autoescape``, define how each template filter +interacts with Django's auto-escaping behavior. They used to be attributes of +the filter function:: + + @register.filter + def noop(value): + return value + noop.is_safe = True + +However, this technique caused some problems in combination with decorators, +especially :func:`@stringfilter <django.template.defaultfilters.stringfilter>`. +Now, the flags are keyword arguments of :meth:`@register.filter +<django.template.Library.filter>`:: + + @register.filter(is_safe=True) + def noop(value): + return value + +See :ref:`filters and auto-escaping <filters-auto-escaping>` for more information. |
