Fixed #4000 - changed documentation to note that filter arguments no longer need to be quoted (and added a test to that effect). Thanks, SmileyChris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5436 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2007-06-07 18:18:44 +00:00
parent 908b72f76d
commit f6491bf984
1 changed files with 6 additions and 3 deletions

View File

@ -91,9 +91,12 @@ Filters can be "chained." The output of one filter is applied to the next.
``{{ text|escape|linebreaks }}`` is a common idiom for escaping text contents, ``{{ text|escape|linebreaks }}`` is a common idiom for escaping text contents,
then converting line breaks to ``<p>`` tags. then converting line breaks to ``<p>`` tags.
Some filters take arguments. A filter argument looks like this: Some filters take arguments. A filter argument looks like this: ``{{
``{{ bio|truncatewords:"30" }}``. This will display the first 30 words of the bio|truncatewords:30 }}``. This will display the first 30 words of the ``bio``
``bio`` variable. Filter arguments always are in double quotes. variable.
Filter arguments that contain spaces must be quoted; for example, to join a list
with commas and spaced you'd use ``{{ list|join:", " }}``.
The `Built-in filter reference`_ below describes all the built-in filters. The `Built-in filter reference`_ below describes all the built-in filters.