Django Book 翻译
菜单>:
TOC
返回
原文:
The ``{% for %}`` tag allows you to loop over each item in a sequence. As in Pythons ``for`` statement, the syntax is ``for X in Y`` , where ``Y`` is the sequence to loop over and ``X`` is the name of the variable to use for a particular cycle of the loop. Each time through the loop, the template system will render everything between ``{% for %}`` and ``{% endfor %}`` .
翻译:
``{% for %}`` 允许我们在一个序列上迭代。与Python的 ``for`` 语句的情形类似,循环语法是 ``for X in Y`` ,Y是要迭代的序列而X是在每一个特定的循环中使用的变量名称。每一次循环中,模板系统会渲染在 ``{% for %}`` 和 ``{% endfor %}`` 之间的所有内容。
备注:
译者: