annotate gpp/templates/forums/post_list.html @ 552:9e42e6618168

For bitbucket issue #2, tweak the admin settings for the Post model to reduce slow queries. Define our own queryset() method so we can control the select_related(), and not have it cascade from post to topics to forums to categories. Removed 'topic' from list_display because MySQL still sucked with 2 inner joins. Now it seems to be tolerable with only one join to User.
author Brian Neal <bgneal@gmail.com>
date Wed, 25 Jan 2012 20:07:03 -0600
parents 593fb6dbd449
children
rev   line source
bgneal@169 1 {% extends 'base.html' %}
bgneal@169 2 {% load forum_tags %}
bgneal@169 3 {% block title %}Forums: {{ title }}{% endblock %}
bgneal@280 4 {% block custom_js %}
bgneal@280 5 {% include "forums/forum_query.js" %}
bgneal@280 6 {% endblock %}
bgneal@169 7 {% block content %}
bgneal@283 8 {% forum_navigation title %}
bgneal@280 9 {% include "forums/forum_query.html" %}
bgneal@169 10 <div class="forum-block">
bgneal@169 11 {{ page_nav }}
bgneal@169 12 {% if page.object_list %}
bgneal@169 13 <dl id="forums-post-list">
bgneal@169 14 {% for post in page.object_list %}
bgneal@169 15 <dt>
bgneal@169 16 <a href="{{ post.topic.forum.get_absolute_url }}" title="Visit Forum">{{ post.topic.forum.name }}</a> &raquo;
bgneal@169 17 <a href="{{ post.topic.get_absolute_url }}" title="Visit Topic">{{ post.topic.name }}</a> &raquo;
bgneal@169 18 <a href="{{ post.get_absolute_url }}" title="View Post in Context">
bgneal@169 19 {% forum_date post.creation_date user %}</a>
bgneal@169 20 </dt>
bgneal@169 21 <dd class="{% cycle 'odd' 'even' %}">
bgneal@169 22 {{ post.html|safe }}
bgneal@169 23 </dd>
bgneal@169 24 {% endfor %}
bgneal@169 25 </dl>
bgneal@169 26 {% else %}
bgneal@169 27 <h4>No posts found.</h4>
bgneal@169 28 {% endif %}
bgneal@169 29 {{ page_nav }}
bgneal@169 30 </div>
bgneal@169 31 {% endblock %}