comparison gpp/templates/downloads/index.html @ 192:341759e1cda1

Implementing #67: use a denormalized count field on download categories to reduce database queries.
author Brian Neal <bgneal@gmail.com>
date Sat, 03 Apr 2010 01:10:00 +0000
parents dbd703f7d63a
children 2baadae33f2e
comparison
equal deleted inserted replaced
191:046e6ef0ff45 192:341759e1cda1
12 <p>We have {{ total_dls }} download{{ total_dls|pluralize }} in {{ categories.count }} categories.</p> 12 <p>We have {{ total_dls }} download{{ total_dls|pluralize }} in {{ categories.count }} categories.</p>
13 <dl> 13 <dl>
14 {% for category in categories %} 14 {% for category in categories %}
15 <dt> 15 <dt>
16 <a href="{% url downloads-category category=category.pk,sort="title",page=1 %}">{{ category.title }}</a> 16 <a href="{% url downloads-category category=category.pk,sort="title",page=1 %}">{{ category.title }}</a>
17 ({{ category.num_downloads }}) 17 ({{ category.count }})
18 </dt> 18 </dt>
19 <dd><p>{{ category.description }}</p></dd> 19 <dd><p>{{ category.description }}</p></dd>
20 {% endfor %} 20 {% endfor %}
21 </dl> 21 </dl>
22 {% endif %} 22 {% endif %}