summaryrefslogtreecommitdiff
path: root/docs/ref/templates
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-02 08:16:33 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-02 08:16:33 +0000
commitdfddf129f07a859f52f04497f6254b675a345f8d (patch)
treef51646dc53a5b2318c2e279a0952adf6d6c88596 /docs/ref/templates
parent851461aa72cc94e7000c3c7713e1d9fb130e0fda (diff)
Fixed #9701 -- Added a "safeseq" template filter.
This is like "safe", except it operates on the individual elements of a sequence, rather than treating the whole argument as a string. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/templates')
-rw-r--r--docs/ref/templates/builtins.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index a79063c9de..17e6e8bf9e 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -1330,6 +1330,21 @@ safe
Marks a string as not requiring further HTML escaping prior to output. When
autoescaping is off, this filter has no effect.
+.. templatefilter:: safeseq
+
+safeseq
+~~~~~~~
+
+Applies the :tfilter:`safe` filter to each element of a sequence. Useful in
+conjunction with other filters that operate on sequences, such as
+:tfilter:`join`. For example::
+
+ {{ some_list|safeseq|join:", " }}
+
+You couldn't use the :tfilter:`safe` filter directly in this case, as it would
+first convert the variable into a string, rather than working with the
+individual elements of the sequence.
+
.. templatefilter:: slice
slice