Apply some low-hanging query count reduction
This commit is contained in:
parent
ff866fa052
commit
564f041b4a
3 changed files with 11 additions and 7 deletions
|
|
@ -27,7 +27,9 @@ class GovPlanSectionDetailView(GovernmentMixin, DetailView):
|
|||
template_name = "froide_govplan/section.html"
|
||||
|
||||
def get_queryset(self):
|
||||
return GovernmentPlanSection.objects.filter(government=self.government)
|
||||
return GovernmentPlanSection.objects.filter(
|
||||
government=self.government
|
||||
).select_related("government")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue