In my views.py i have :
credits_total = Course.objects.filter(dept = dept_code1, b_tech = 1, type = 1).values('sem').annotate(sum = Sum('credits'))
So credits_total has the following:
credits_total = [{'sem': 3, 'sum': 19},{'sem': 4, 'sum': 20},{'sem': 5, 'sum': 21},{'sem':6,'sum':22},{'sem':7,'sum':21},{'sem':8,'sum':24}]
I want to do somthing like:
{% for i in "012345" %}
....
<b> {{credits_total[i]['sum']}} </b>
...
{% endfor %}
How can i access a specific key in the dictionary at a specific index in the list?
I'm new to django so could you Plz explain in detail. Thank you!