remove query per row on search page
This commit is contained in:
parent
cbd9c1158d
commit
dd60f43182
2 changed files with 11 additions and 8 deletions
|
@ -143,7 +143,10 @@ def search(request, full=True):
|
|||
template_dir = 'djangobb_forum/' if full else 'djangobb_forum/mobile/'
|
||||
|
||||
def _render_search_form(form=None):
|
||||
return render(request, template_dir + 'search_form.html', {'categories': Category.objects.all(),
|
||||
# TODO: remove 'in' clause from following query
|
||||
categories_with_forums = Category.objects.prefetch_related('forums')
|
||||
return render(request, template_dir + 'search_form.html', {
|
||||
'categories': categories_with_forums,
|
||||
'form': form,
|
||||
})
|
||||
|
||||
|
|
Reference in a new issue