Skip to content

Commit

Permalink
uses get_queryset method to calculate facets
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed Jul 16, 2024
1 parent 162445d commit d055402
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions peachjam/views/generic_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def add_facets(self, context):
natures = list(
doc_n
for doc_n in self.form.filter_queryset(
self.get_base_queryset(), exclude="natures"
self.get_queryset(), exclude="natures"
)
.order_by()
.values_list("nature__name", flat=True)
Expand All @@ -153,7 +153,7 @@ def add_facets(self, context):
authors = list(
a
for a in self.form.filter_queryset(
self.get_base_queryset(), exclude="authors"
self.get_queryset(), exclude="authors"
)
.order_by()
.values_list("authors__name", flat=True)
Expand All @@ -162,13 +162,13 @@ def add_facets(self, context):
)

years = list(
self.form.filter_queryset(self.get_base_queryset(), exclude="years")
self.form.filter_queryset(self.get_queryset(), exclude="years")
.order_by()
.values_list("date__year", flat=True)
.distinct()
)
taxonomies = list(
self.form.filter_queryset(self.get_base_queryset(), exclude="taxonomies")
self.form.filter_queryset(self.get_queryset(), exclude="taxonomies")
.filter(taxonomies__topic__isnull=False)
.order_by()
.values_list("taxonomies__topic__name", flat=True)
Expand Down

0 comments on commit d055402

Please sign in to comment.