Ticket #17110: filter-tag-doc-note.diff

File filter-tag-doc-note.diff, 1.2 KB (added by Ben Spaulding, 13 years ago)

Filter tag documentation patch.

  • django/template/defaulttags.py

    diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
    index 9620d1c..3ef5272 100644
    a b def do_filter(parser, token):  
    607607        {% filter force_escape|lower %}
    608608            This text will be HTML-escaped, and will appear in lowercase.
    609609        {% endfilter %}
     610
     611    Note that the ``escape`` and ``safe`` filters are not acceptable arguments.
     612    Instead, use the ``autoescape`` tag to manage autoescaping for blocks of
     613    template code.
    610614    """
    611615    _, rest = token.contents.split(None, 1)
    612616    filter_expr = parser.compile_filter("var|%s" % (rest))
  • docs/ref/templates/builtins.txt

    diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
    index 4e5c124..a3fc485 100644
    a b Sample usage::  
    227227        This text will be HTML-escaped, and will appear in all lowercase.
    228228    {% endfilter %}
    229229
     230.. note::
     231
     232    The :tfilter:`escape` and :tfilter:`safe` filters are not acceptable
     233    arguments. Instead, use the :ttag:`autoescape` tag to manage autoescaping
     234    for blocks of template code.
     235
    230236.. templatetag:: firstof
    231237
    232238firstof
Back to Top