diff --git a/bakerydemo/breads/models.py b/bakerydemo/breads/models.py index 477c19137..b6dcead0a 100644 --- a/bakerydemo/breads/models.py +++ b/bakerydemo/breads/models.py @@ -237,7 +237,8 @@ def children(self): # Pagination for the index page. We use the `django.core.paginator` as any # standard Django app would, but the difference here being we have it as a # method on the model rather than within a view function - def paginate(self, request, *args): + def paginate(self, request, queryset=None): + queryset = queryset or self.get_breads() page = request.GET.get("page") paginator = Paginator(self.get_breads(), 12) try: @@ -254,7 +255,7 @@ def get_context(self, request): context = super(BreadsIndexPage, self).get_context(request) # BreadPage objects (get_breads) are passed through pagination - breads = self.paginate(request, self.get_breads()) + breads = self.paginate(request) context["breads"] = breads