Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context = {
- 'list_one': list_one,
- 'list_two': list_two,
- 'loops': range(8)
- }
- return render(request, 'some/under.html', context)
- {% for i in loops %}
- <li>
- <p>{{ list_one.i }}</p>
- <span class="count">{{ list_two.i }}%</span>
- <span class="index" style="width: {{ list_two.i }}%"></span>
- </li>
- {% endfor %}
- context = dict(pairs=zip(list_one, list_two))
- return render(request, 'some/under.html', context)
- {% for item_from_list_one, item_from_list_two in context.pairs %}
- <li>
- <p>{{ item_from_list_one }}</p>
- <span class="count">{{ item_from_list_two }}%</span>
- <span class="index" style="width: {{ item_from_list_two }}%"></span>
- </li>
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement