Author: julien
Date: 2011-09-24 22:21:29 -0700 (Sat, 24 Sep 2011)
New Revision: 16902
Modified:
django/trunk/django/template/defaulttags.py
django/trunk/docs/ref/templates/builtins.txt
Log:
Fixed #16927 -- Corrected the `{% ifchanged %}` template tag's documentation.
Thanks to sebastian for the report and patch.
Modified: django/trunk/django/template/defaulttags.py
===================================================================
--- django/trunk/django/template/defaulttags.py 2011-09-24 19:48:27 UTC (rev
16901)
+++ django/trunk/django/template/defaulttags.py 2011-09-25 05:21:29 UTC (rev
16902)
@@ -936,7 +936,8 @@
"""
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 @@
<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 %}
Modified: django/trunk/docs/ref/templates/builtins.txt
===================================================================
--- django/trunk/docs/ref/templates/builtins.txt 2011-09-24 19:48:27 UTC
(rev 16901)
+++ django/trunk/docs/ref/templates/builtins.txt 2011-09-25 05:21:29 UTC
(rev 16902)
@@ -555,7 +555,8 @@
Check 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 list of
@@ -568,9 +569,9 @@
<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 has 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 %}
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.