oTree Forum >

reverse list in templates

#1 by dimdub34

Hello everyone,

With django it was possible to reverse a list, for example for an history with the current round first : 
{% for p in player.in_all_rounds|reverse %}
...
{% endfor %}

Is there a corresponding filter in otree 5 ? More generally, what is the library that parses the templates ? I understand that it is not jinja 2.

Thank you

Dimitri

#2 by jkupb

You should do the reversing the vars_for_template method.

Write a reply

Set forum username