Ticket #4000: filterarguments.diff
File filterarguments.diff, 1.5 KB (added by , 18 years ago) |
---|
-
tests/regressiontests/templates/tests.py
219 219 # value will be converted to a bytestring. 220 220 'filter-syntax18': (r'{{ var }}', {'var': UnicodeInStrClass()}, '\xc5\xa0\xc4\x90\xc4\x86\xc5\xbd\xc4\x87\xc5\xbe\xc5\xa1\xc4\x91'), 221 221 222 # Numbers as filter arguments should work 223 'filter-syntax19': ('{{ var|truncatewords:1 }}', {"var": "hello world"}, "hello ..."), 224 222 225 ### COMMENT SYNTAX ######################################################## 223 226 'comment-syntax01': ("{# this is hidden #}hello", {}, "hello"), 224 227 'comment-syntax02': ("{# this is hidden #}hello{# foo #}", {}, "hello"), -
docs/templates.txt
92 92 then converting line breaks to ``<p>`` tags. 93 93 94 94 Some filters take arguments. A filter argument looks like this: 95 ``{{ bio|truncatewords: "30"}}``. This will display the first 30 words of the96 ``bio`` variable. Filter arguments always are in double quotes.95 ``{{ bio|truncatewords:30 }}``. This will display the first 30 words of the 96 ``bio`` variable. 97 97 98 98 The `Built-in filter reference`_ below describes all the built-in filters. 99 99