summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2011-09-25 05:21:29 +0000
committerJulien Phalip <jphalip@gmail.com>2011-09-25 05:21:29 +0000
commit482388cd61ee97d8898097fb6777c5d7ca4216af (patch)
tree99d21f4251f5f87d1fa1961aa9b26201a963ec3d /django
parent4c457bca85b5410c47860ee4c5df0b47d48f2603 (diff)
Fixed #16927 -- Corrected the `{% ifchanged %}` template tag's documentation. Thanks to sebastian for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/template/defaulttags.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 125cd9ed55..0b039a5e00 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -936,7 +936,8 @@ def ifchanged(parser, token):
"""
Checks if a value has changed from the last iteration of a loop.
- The 'ifchanged' block tag is used within a loop. It has two possible uses.
+ The ``{% ifchanged %}`` block tag is used within a loop. It has two
+ possible uses.
1. Checks its own rendered contents against its previous state and only
displays the content if it has changed. For example, this displays a
@@ -949,9 +950,9 @@ def ifchanged(parser, token):
<a href="{{ date|date:"M/d"|lower }}/">{{ date|date:"j" }}</a>
{% endfor %}
- 2. If given a variable, check whether that variable has changed.
- For example, the following shows the date every time it changes, but
- only shows the hour if both the hour and the date have changed::
+ 2. If given one or more variables, check whether any variable has changed.
+ For example, the following shows the date every time it changes, while
+ showing the hour if either the hour or the date has changed::
{% for date in days %}
{% ifchanged date.date %} {{ date.date }} {% endifchanged %}