Fixed #36186 -- Added forloop.length variable within a template for loop.

This commit is contained in:
Jonathan Ströbele 2025-02-13 16:23:29 +01:00 committed by Sarah Boyce
parent 582ba18d56
commit 240421c7c4
4 changed files with 30 additions and 2 deletions

View file

@ -423,10 +423,15 @@ Variable Description
loop (0-indexed)
``forloop.first`` True if this is the first time through the loop
``forloop.last`` True if this is the last time through the loop
``forloop.length`` The length of the loop
``forloop.parentloop`` For nested loops, this is the loop surrounding
the current one
========================== ===============================================
.. versionchanged:: 6.0
The variable ``forloop.length`` was added.
``for`` ... ``empty``
---------------------