Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. context = {
  2. 'list_one': list_one,
  3. 'list_two': list_two,
  4. 'loops': range(8)
  5. }
  6. return render(request, 'some/under.html', context)
  7.  
  8. {% for i in loops %}
  9. <li>
  10. <p>{{ list_one.i }}</p>
  11. <span class="count">{{ list_two.i }}%</span>
  12. <span class="index" style="width: {{ list_two.i }}%"></span>
  13. </li>
  14. {% endfor %}
  15.  
  16. context = dict(pairs=zip(list_one, list_two))
  17. return render(request, 'some/under.html', context)
  18.  
  19. {% for item_from_list_one, item_from_list_two in context.pairs %}
  20. <li>
  21. <p>{{ item_from_list_one }}</p>
  22. <span class="count">{{ item_from_list_two }}%</span>
  23. <span class="index" style="width: {{ item_from_list_two }}%"></span>
  24. </li>
  25. {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement