Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #18933. Fixes code example in docstring.

Makes code example of silent keyword docstring in cycle templatetag
method the same as in the documentation.
  • Loading branch information...
commit 3fb2662edcdfb03ebb4b2ab60ffe309104809246 1 parent 5e99a3d
@martey martey authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 django/template/defaulttags.py
View
6 django/template/defaulttags.py
@@ -531,11 +531,9 @@ def cycle(parser, token):
The optional flag "silent" can be used to prevent the cycle declaration
from returning any value::
- {% cycle 'row1' 'row2' as rowcolors silent %}{# no value here #}
{% for o in some_list %}
- <tr class="{% cycle rowcolors %}">{# first value will be "row1" #}
- ...
- </tr>
+ {% cycle 'row1' 'row2' as rowcolors silent %}
+ <tr class="{{ rowcolors }}">{% include "subtemplate.html " %}</tr>
{% endfor %}
"""
Please sign in to comment.
Something went wrong with that request. Please try again.