Still reducing the number of queries on the Forum

Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
Skia
2017-05-30 22:10:50 +02:00
parent ba65dc5d46
commit 06b67f1d27
6 changed files with 26 additions and 22 deletions

View File

@ -36,7 +36,7 @@
</div>
</div>
{{ display_forum(forum, user, True) }}
{% for f in forum.children.all() %}
{% for f in forum.children.all().select_related("_last_message__author", "_last_message__topic") %}
{{ display_forum(f, user) }}
{% endfor %}
{% endif %}

View File

@ -69,7 +69,7 @@
{{ user_profile_link(topic.author) }}
</p>
<p class="ib w_medium" style="text-align: center;">
{{ topic.messages.count() }}
{{ topic._message_number }}
</p>
</div>
<p class="ib w_medium" style="text-align: center;">