I think the answer you're looking for is to use something like this:
{% for tuple in items | dictsort %}
<p>{{tuple[0]}}, {{tuple[1]}}</p>
{% endfor %}
Very simply the dictsort filter returns a list of tuples(key-value pair) from the object in a sorted manner, which can then be accessed as follows.
So, if the object is
items: {
someId1:
{
property1....
},
someId2: {...},
someIdN: {...}
}
You would get,
[['someid1',{property1: ..}], ['someid2','...'], ['someid3','...']]
Now you can just use the loop as if you were looping through an array. Keep in mind that additional nested properties must be handled manually too.
The previous answers suggested manually extracting each property. What if I wanted the same page with data that has 5 properties as well as 10 properties. What if I wanted all keys by not specifying them? Which is something I came across and stumbled upon this question. As of 2022, we can use dictsort
but previous answers may worked just as well.