Open TheWebTech opened 5 years ago
One possible workaround for developers would be to do {% set items = ["new value"] + items[1:] %}
We could support setItem
on Pylist
. So this would look like {% do items.setItem(0, "new value") %}
. There isn't supported directly in Jinja2 though.
{% do items.set(0, "new value") %}
should work actually
Code explains better than words could.
We have list functions, but none seem to recreate the same sort of simple functionality that many programming languages support.