comparison gpp/templates/weblinks/index.html @ 193:fa7d82bfb100

Implement #68: add a denormalized count field to weblinks Category model to reduce database queries.
author Brian Neal <bgneal@gmail.com>
date Sat, 03 Apr 2010 02:15:04 +0000
parents dbd703f7d63a
children 2baadae33f2e
comparison
equal deleted inserted replaced
192:341759e1cda1 193:fa7d82bfb100
5 {% if categories %} 5 {% if categories %}
6 <p>We have {{ total_links }} links in {{ categories.count }} categories.</p> 6 <p>We have {{ total_links }} links in {{ categories.count }} categories.</p>
7 <dl> 7 <dl>
8 {% for category in categories %} 8 {% for category in categories %}
9 <dt><a href="{% url weblinks-view_links category=category.id,sort="title",page=1 %}">{{ category.title }}</a> 9 <dt><a href="{% url weblinks-view_links category=category.id,sort="title",page=1 %}">{{ category.title }}</a>
10 ({{ category.num_links}})</dt> 10 ({{ category.count }})</dt>
11 <dd><p>{{ category.description }}</p></dd> 11 <dd><p>{{ category.description }}</p></dd>
12 {% endfor %} 12 {% endfor %}
13 </dl> 13 </dl>
14 {% endif %} 14 {% endif %}
15 {% endblock %} 15 {% endblock %}