In a Django template, is there a way to get a value id, score and num_votes from Data Structure:
{
1: {'score': 0, 'num_votes': 2},
2: {'score': -1, 'num_votes': 1},
3: {'score': 2, 'num_votes': 2},
6: {'score': 1, 'num_votes': 1},
7: {'score': 2, 'num_votes': 2}
}
Example:
1 0 2
2 -1 1
In django template, but throws error:
{% scores_for_objects list_status as scores %}
{% for status,value in scores.items %}
{{status}}**{{value.'score'}}
{{value.'num_votes'}}**{% endfor %}
That’s not how you do it.