title: django value error need more than one value to unpack
body: <p>Please before my answer is marked as duplicate, I would appreciate if someone went through it first.
  I'm trying to access a products page in an ecommerce project but when I try to access the page I get a value error as below:</p>
  
  <pre><code>Internal Server Error: /product_view/1/
  Traceback (most recent call last):
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
      response = get_response(request)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
      response = self.process_exception_by_middleware(e, request)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/home/agozie/shoppingmall/shop/views.py", line 15, in product_view
      p = get_object_or_404(Product, product_slug)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/shortcuts.py", line 85, in get_object_or_404
      return queryset.get(*args, **kwargs)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/query.py", line 371, in get
      clone = self.filter(*args, **kwargs)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/query.py", line 784, in filter
      return self._filter_or_exclude(False, *args, **kwargs)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/query.py", line 802, in _filter_or_exclude
      clone.query.add_q(Q(*args, **kwargs))
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1250, in add_q
      clause, _ = self._add_q(q_object, self.used_aliases)
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1276, in _add_q
      allow_joins=allow_joins, split_subq=split_subq,
    File "/home/agozie/anaconda3/envs/env1/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1151, in build_filter
      arg, value = filter_expr
  ValueError: need more than 1 value to unpack
  [13/Aug/2017 19:07:23] "GET /product_view/1/ HTTP/1.1" 500 104231
  </code></pre>
  
  <p>I have gone through all other questions relating to mine but they all have something to do with splitting a code.</p>
  
  <p>Here is my models.py:</p>
  
  <pre><code>class Product(models.Model):
      name = models.CharField(max_length=50)
      slug = models.SlugField(max_length=50, unique=True)
      color_id = models.ManyToManyField(Color)
      gender = models.CharField(max_length=2,choices=(('M','Male'),('F','Female')))
      brand_id = models.ManyToManyField(Brand)
      image = models.ImageField(upload_to='product_images',blank=False)
      features = models.TextField()
      quantity = models.IntegerField(default=0)
      style = models.ManyToManyField(Style)
      sub_category_id = models.ForeignKey(Sub_Category)
      old_price = models.DecimalField(max_digits=15, decimal_places=2, blank=True, default=0.00)
      price = models.DecimalField(max_digits=15,decimal_places=2, null=False)
      availability = models.BooleanField(default=False)
      retailer_id = models.ForeignKey(Retailer)
      shipping_cost= models.IntegerField(default=1000)
      categories = models.ManyToManyField(Category)
      created_at = models.DateTimeField(auto_now=True)
  
      def save(self, *args, **kwargs):
          # self.author = self.author.upper()
          self.slug = slugify(self.name)
          super(Product, self).save(*args,**kwargs)
  
      def __str__(self):
          return self.name
  
      @models.permalink
      def get_absolute_url(self):
          return('shop_product', (), {'product_slug':'self.slug'})
  
      def sale_price(self):
          if self.old_price &gt; self.price:
              return self.price
          else:
              return None
  </code></pre>
  
  <p>And below is my views.py:</p>
  
  <pre><code>def product_view(request, product_slug):
      p = get_object_or_404(Product, product_slug)
      categories = p.categories.filter(is_active=True)
      return render(request,'shop/product_view.html')
  </code></pre>
  
  <p>I am using Django 1.11 and Python 2.7.13</p>