class artichels_pagination(ListView):
queryset =models.article.objects.all().order_by('-upload')
template_name = 'blog.html'
def get(self,request):
page_artichel = Paginator(self.queryset, 2)
page_number = request.GET.get('page')
page_obj = page_artichel.get_page(page_number)
render(request,self.template_name,context={'artichel':page_obj})
字符串
这是错误:
artichels_pagination.get() missing 1 required positional argument: 'request'
型
1条答案
按热度按时间ni65a41a1#
尝试使用此解决方案
字符串