Fixed #17110 -- Mentionned that the {% filter %} tag doesn't support the 'safe' and 'escape' filters. Thanks benspaulding.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin 2011-12-24 20:45:58 +00:00
parent d72c0bdc46
commit 4c445fdfaa
2 changed files with 10 additions and 0 deletions

View File

@ -617,6 +617,10 @@ def do_filter(parser, token):
{% filter force_escape|lower %} {% filter force_escape|lower %}
This text will be HTML-escaped, and will appear in lowercase. This text will be HTML-escaped, and will appear in lowercase.
{% endfilter %} {% endfilter %}
Note that the ``escape`` and ``safe`` filters are not acceptable arguments.
Instead, use the ``autoescape`` tag to manage autoescaping for blocks of
template code.
""" """
_, rest = token.contents.split(None, 1) _, rest = token.contents.split(None, 1)
filter_expr = parser.compile_filter("var|%s" % (rest)) filter_expr = parser.compile_filter("var|%s" % (rest))

View File

@ -237,6 +237,12 @@ Sample usage::
This text will be HTML-escaped, and will appear in all lowercase. This text will be HTML-escaped, and will appear in all lowercase.
{% endfilter %} {% endfilter %}
.. note::
The :tfilter:`escape` and :tfilter:`safe` filters are not acceptable
arguments. Instead, use the :ttag:`autoescape` tag to manage autoescaping
for blocks of template code.
.. templatetag:: firstof .. templatetag:: firstof
firstof firstof