EDIT : I have a python list like this obtained by requesting a mongodb database :
db.coll.find()
> ["Create", "Infra", "Consolidate"]
Is there a way to say in jinja2 template to sort the list in a defined order ? I want an order like this :
["Infra", "Create", "Consolidate"]
I would be happy if something like the following worked. Unfortunately, this is not the case :
{% for item in list|sort("Infra", "Create", "Consolidate") %}
{{ item }}
{% endfor %}