...

Text file src/github.com/noirbizarre/gonja/testData/filters/groupby.tpl

Documentation: github.com/noirbizarre/gonja/testData/filters

     1<ul>
     2{%- for group in persons|groupby('Gender') %}
     3    <li>{{ group.grouper }}<ul>
     4    {%- for person in group.list %}
     5        <li>{{ person.FirstName }} {{ person.LastName }}</li>
     6    {%- endfor %}
     7    </ul></li>
     8{%- endfor %}
     9</ul>
    10
    11<ul>
    12{%- for group in groupable|groupby('grouper') %}
    13    <li>{{ group.grouper }}<ul>
    14    {%- for value in group.list %}
    15        <li>{{ value.value }}</li>
    16    {%- endfor %}
    17    </ul></li>
    18{%- endfor %}
    19</ul>

View as plain text