def get(self, request,category_slug):
user = request.user
cat = SubCategory.objects.filter(slug = category_slug)
prod = Product.objects.filter(category_sub = cat ).order_by('-created_date')
paginator = Paginator(prod,12)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
context={
'cat':cat,
'page_obj':page_obj,
}
return render(request, 'category.html',context)
https://linkode.org/
Обсуждают сегодня