~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to docs/topics/templates.txt

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2014-04-21 16:47:14 UTC
  • mfrom: (1.3.14)
  • Revision ID: package-import@ubuntu.com-20140421164714-3mlvyr7y1ssdo9e6
Tags: 1.6.3-1
* New upstream security release.
  - Unexpected code execution using ``reverse()``
  - CVE-2014-0472
  - Caching of anonymous pages could reveal CSRF token
  - CVE-2014-0473
  - MySQL typecasting could result in unexpected matches
  - CVE-2014-0474
* Drop patches 07_translation_encoding_fix and ticket21869.diff; merged
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        {% endfor %}
212
212
        </ul>
213
213
 
214
 
:ttag:`if` and ``else``
 
214
:ttag:`if`, ``elif``, and ``else``
215
215
    Evaluates a variable, and if that variable is "true" the contents of the
216
216
    block are displayed::
217
217
 
218
218
        {% if athlete_list %}
219
219
            Number of athletes: {{ athlete_list|length }}
 
220
        {% elif athlete_in_locker_room_list %}
 
221
            Athletes should be out of the locker room soon!
220
222
        {% else %}
221
223
            No athletes.
222
224
        {% endif %}
223
225
 
224
226
    In the above, if ``athlete_list`` is not empty, the number of athletes
225
 
    will be displayed by the ``{{ athlete_list|length }}`` variable.
 
227
    will be displayed by the ``{{ athlete_list|length }}`` variable. Otherwise,
 
228
    if ``athlete_in_locker_room_list`` is not empty, the message "Athletes
 
229
    should be out..." will be displayed. If both lists are empty,
 
230
    "No athletes." will be displayed.
226
231
 
227
232
    You can also use filters and various operators in the :ttag:`if` tag::
228
233