A
A
Almaz Akimov2021-12-04 15:51:11
Django
Almaz Akimov, 2021-12-04 15:51:11

How to sort in Jinja?

Why doesn't the design work? Invalid filter: 'sort'

{% for p in movie.list|sort(attribute='time') %}
        {{movie.list}}
        <button type="button" class="btn btn-primary">{{ p.time }}</button>
        		{% endfor %}

If a

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Almaz Akimov, 2021-12-04
@GolosB

Found the answer. This is a dictionary.
{% for p in movie.list|dictsort:"time" %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question