Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Getting the next item in a loop
- {% regroup communities|dictsort:"in_country" by in_country as community_list %}
- {% for in_country in community_list %}
- <h2 style="font-size:16px;">{{ in_country.grouper }}</h2>
- <table cellspacing="0">
- {% for item in in_country.list|dictsort:"name" %}
- <tr style="text-align:center;">
- <td width="200px" class='community_table'>
- <img src="{{ item.image }}" style="height:40px;"><br />
- <a href='{{ item.url }}' style="font-size:10px; margin-left:10px;" TARGET = "_blank">{{ item.name }}</a><br />
- {{ item.com_type }}<br />
- {{ item.in_city }}<br />
- </td>
- <td width="200px" class='community_table'>
- <img src="{{ item.image }}" style="height:40px;"><br />
- <a href='{{ item.url }}' style="font-size:10px; margin-left:10px;" TARGET = "_blank">{{ item.name }}</a><br />
- {{ item.com_type }}<br />
- {{ item.in_city }}<br />
- </td>
- <td width="200px" class='community_table'>
- <img src="{{ item.image }}" style="height:40px;"><br />
- <a href='{{ item.url }}' style="font-size:10px; margin-left:10px;" TARGET = "_blank">{{ item.name }}</a><br />
- {{ item.com_type }}<br />
- {{ item.in_city }}<br />
- </td>
- <td width="200px" class='community_table'>
- <img src="{{ item.image }}" style="height:40px;"><br />
- <a href='{{ item.url }}' style="font-size:10px; margin-left:10px;" TARGET = "_blank">{{ item.name }}</a><br />
- {{ item.com_type }}<br />
- {{ item.in_city }}<br />
- </td>
- {% endfor %}
- </table>
- {% endfor %}
- <table cellspacing="0">
- {% for item in in_country.list|dictsort:"name" %}
- {% if forloop.counter0|divisibleby:4 %}
- <tr style="text-align:center;">
- {% endif %}
- <td width="200px" class='community_table'>
- <img src="{{ item.image }}" style="height:40px;"><br />
- <a href='{{ item.url }}' style="font-size:10px; margin-left:10px;" TARGET = "_blank">{{ item.name }}</a><br />
- {{ item.com_type }}<br />
- {{ item.in_city }}<br />
- </td>
- {% if forloop.counter|divisibleby:4 %}
- </tr>
- {% endif %}
- {% endfor %}
- </table>
- my_iter = iter(my_list)
- grouped = zip(my_iter, my_iter, my_iter, my_iter) # or zip(*[my_iter]*4)
Add Comment
Please, Sign In to add comment