rel #713, remove more queries from search results page

This commit is contained in:
Glen Chiacchieri 2013-04-05 13:13:39 +00:00
parent 7e38d90ba0
commit 1d144ab6f1

View file

@ -168,7 +168,7 @@ def search(request, full=True):
viewable_category = viewable_category.filter(Q(groups__in=user_groups) | Q(groups__isnull=True))
topics = Topic.objects.filter(forum__category__in=viewable_category) \
.select_related('last_post', 'last_post__user')
.select_related('last_post', 'last_post__user', 'user', 'forum')
posts = Post.objects.filter(topic__forum__category__in=viewable_category)
base_url = None