fix: pagination
This commit is contained in:
+4
-2
@@ -22,10 +22,12 @@ class ListProducts(TemplateView, FilteredQuerysetMixin, PaginatedQuerysetMixin):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
qs = self.get_queryset()
|
||||
products = self.get_paginated_queryset(qs)
|
||||
page = self.get_paginated_queryset(qs)
|
||||
|
||||
return {
|
||||
"products": products,
|
||||
"page": page,
|
||||
"has_next_page": page.has_next(),
|
||||
"has_previous_page": page.has_previous(),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user