Skip to content

Commit

Permalink
Save self.objects on admin list view for other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Jan 18, 2024
1 parent 58f4bfc commit 6f4994e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bolt-staff/bolt/admin/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ def get_context(self):
# Make this available on self for usage in get_objects and other methods
self.filter = self.request.GET.get("filter", "")

# Make this available to get_filters and stuff
self.objects = self.get_objects()

page_size = self.request.GET.get("page_size", self.page_size)
paginator = Paginator(self.get_objects(), page_size)
paginator = Paginator(self.objects, page_size)
self._page = paginator.get_page(self.request.GET.get("page", 1))

context["paginator"] = paginator
Expand Down

0 comments on commit 6f4994e

Please sign in to comment.