Commit bef0aae7 authored by fred's avatar fred

performance: archive view

(92 queries → 15)
parent edc37b4a
...@@ -392,7 +392,7 @@ class Archives(TemplateView): ...@@ -392,7 +392,7 @@ class Archives(TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(Archives, self).get_context_data(**kwargs) context = super(Archives, self).get_context_data(**kwargs)
context['sectionName'] = "Emissions" context['sectionName'] = "Emissions"
context['emissions'] = Emission.objects.all().filter(archived=True).order_by('title') context['emissions'] = Emission.objects.prefetch_related('categories').filter(archived=True).order_by('title')
return context return context
archives = Archives.as_view() archives = Archives.as_view()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment