summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-12-09 22:13:27 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-12-09 22:13:27 +0000
commit19cbdf8c8f6f5da5687cfec659841176b6af7d67 (patch)
tree5d30e0ad0f83b2e2c9dbd25c77c6c26da4aff4d0 /docs
parent959f78b3c6fa77dc7df9cd449634dda240e12c75 (diff)
Fixed #17348 -- Implemented {% elif %}. Refs #3100.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/templates/builtins.txt11
-rw-r--r--docs/releases/1.4.txt2
2 files changed, 11 insertions, 2 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 8abe129915..c592b79037 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -366,6 +366,8 @@ block are output::
{% if athlete_list %}
Number of athletes: {{ athlete_list|length }}
+ {% elif athlete_in_locker_room_list %}
+ Athletes should be out of the locker room soon!
{% else %}
No athletes.
{% endif %}
@@ -373,8 +375,13 @@ block are output::
In the above, if ``athlete_list`` is not empty, the number of athletes will be
displayed by the ``{{ athlete_list|length }}`` variable.
-As you can see, the ``if`` tag can take an optional ``{% else %}`` clause that
-will be displayed if the test fails.
+As you can see, the ``if`` tag may take one or several `` {% elif %}``
+clauses, as well as an ``{% else %}`` clause that will be displayed if all
+previous conditions fail. These clauses are optional.
+
+.. versionadded:: 1.4
+
+The ``if`` tag now supports ``{% elif %}`` clauses.
Boolean operators
^^^^^^^^^^^^^^^^^
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
index 484f008943..491556bfa2 100644
--- a/docs/releases/1.4.txt
+++ b/docs/releases/1.4.txt
@@ -484,6 +484,8 @@ Django 1.4 also includes several smaller improvements worth noting:
be able to retrieve a translation string without displaying it but setting
a template context variable instead.
+* The :ttag:`if` template tag now supports ``{% elif %}`` clauses.
+
* A new plain text version of the HTTP 500 status code internal error page
served when :setting:`DEBUG` is ``True`` is now sent to the client when
Django detects that the request has originated in JavaScript code