title: Error when i click on a category
body: <p>I'm building an e-commerce website.
  I have a model with two class(Category and Product),
  I recently added pagination to my list_view and its working on my products but when I click on the category class, I get an error.</p>
  
  <pre><code> from django.shortcuts import render, get_object_or_404 from .models
   import Category, Product from cart.forms import CartAddProductForm
   from django.contrib.auth.decorators import login_required from
   django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
   from django.db.models import Q
  
   def product_list(request, category_slug=None):
       category = None
       categories = Category.objects.all()
       products = Product.objects.filter(available=True)
       query = request.GET.get("q")
       if query:
           products = Product.objects.filter(Q(name__icontains=query) | 
                            Q(description__icontains=query)).distinct()
       paginator = Paginator(products, 10,)
       page = request.GET.get('page', 2)
       try:
           products= paginator.page(page)
       except PageNotAnInteger:
           # If page is not an integer deliver the first page
           products = paginator.page(1)
       except EmptyPage:
           # If page is out of range deliver last page of results
           products = paginator.page(paginator.num_pages)
       if category_slug:
           category = get_object_or_404(Category, slug = category_slug)
           products = products.filter(category=Category)
       return render(request, 'shop/product/list.html', {'category':category, 'categories': categories, 'products': products, 'page': page})
  
   @login_required def product_detail(request, id, slug):
       product = get_object_or_404(Product,id=id,slug=slug,available=True)
       cart_product_form = CartAddProductForm()
       return render(request,'shop/product/detail.html', {'product': product, 'cart_product_form': cart_product_form})
  </code></pre>
  
  <p>When I click on product, it works fine and the pagination also works but when I click on category to display other sets of products, it displays this error:</p>
  
  <pre><code> Traceback:
  
   File
   "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site- 
       packages\django-2.0.2-py3.6.egg\django\core\handlers\exception.py"
      in inner
     35.             response = get_response(request)
  
   File
   "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site- 
      packages\django-2.0.2-py3.6.egg\django\core\handlers\base.py"
     in _get_response
     128.                 response = self.process_exception_by_middleware(e, 
                                                                    request)
  
   File
   "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site- 
         packages\django-2.0.2-py3.6.egg\django\core\handlers\base.py"
                         in _get_response
     126.                 response = wrapped_callback(request, 
                                            *callback_args, **callback_kwargs)
  
   File "C:\Users\user\Documents\my webpages\socialapp\shop\views.py" in
   product_list
     30.         products = products.filter(category=Category)
  
   Exception Type: AttributeError at /shop/softwares-games/ Exception
   **Value: 'Page' object has no attribute 'filter'**
  </code></pre>