есть такой код:
views.py
class ProductsList(ListView):
paginate_by = 3
template_name = 'products/list.html'
model = Product
def product_list(request, category_slug=None):
category = None
categories = Category.objects.all()
products = Product.objects.filter(available=True)
prods_list = Product.objects.all()
paginator = Paginator(prods_list, 3)
page = request.GET.get('page')
prods = paginator.get_page(page)
if category_slug:
category = get_object_or_404(Category, slug=category_slug)
products = products.filter(category=category)
return render(request,
'products/list.html',
{'category': category,
'categories': categories,
'products': products,
'prods': prods})
urls.py
urlpatterns = [
url(r'^$', views.product_list, name='product_list'),
url(r'^(?P<category_slug>[-\w]+)/$',
views.product_list,
name='product_list_by_category'),
url(r'^(?P<id>\d+)/(?P<slug>[-\w]+)/$',
views.product_detail,
name='product_detail'),
]
paginator.html
<div class="pagination">
<span class="step-links">
{% if prods.has_previous %}
<a href="?page=1">« first</a>
<a href="?page={{ prods.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
Page {{ prods.number }} of {{ prods.paginator.num_pages }}.
</span>
{% if prods.has_next %}
<a href="?page={{ prods.next_page_number }}">next</a>
<a href="?page={{ prods.paginator.num_pages }}">last »</a>
{% endif %}
</span>
</div>
элементы управления пагинацией есть, кол-во страниц высчитывает верно, но на странице отображаются все элементы, вместо положенных 3. подскажите в чем ошибся?