I use framework Flask, python, jinja2 . I transfer the dictionary with three lists:
attendance = {'total': ['1', ' 5', ' 8', ' 12', ' 15', ' 19', ' 22', ' 26'], 'spravka': ['5'], 'unattended': ['1']} I want to display each value in the total list in a separate li tag. But this does not work. The value is always displayed 1. The cycle does not pass. What's wrong?
<ul> {% set count = 0 %} {% for i in attendance.total %} <li>{{ attendance.total[count] }}</li> {% set count = count + 1 %} {% endfor %} </ul> @app.route('/protected') @app.route('/visits_s') def visits_s(): #........ attendance = fetch_attendance_data() return render_template("visits_s.html", attendance=attendance)
attendancesyntactically incorrect, the program will simply not start. - Sergey Gornostaevfor item in attendance['total']: #some code- kot_mapku3