title: TypeError: cannot unpack non-iterable int object in Django rest framework
body: <p>I am trying to get a list of orders of only those products associated with that merchant. In my project, every product is associated with a merchant. In the merchant dashboard, merchants should be able to view only their products and orders.</p>
  <p>When I try to filter the orders based on products associated with that merchant, I got the above error.</p>
  <p>My models:</p>
  <pre><code>class Product(models.Model):  
      
      merchant = models.ForeignKey(Seller,on_delete=models.CASCADE,blank=True,null=True)
      category = models.ManyToManyField(Category, blank=False)
      brand = models.ForeignKey(Brand, on_delete=models.CASCADE)
  
  class Order(models.Model):
      ORDER_STATUS = (
          ('To_Ship', 'To Ship',),
          ('Shipped', 'Shipped',),
          ('Delivered', 'Delivered',),
          ('Cancelled', 'Cancelled',),
      )
      user = models.ForeignKey(User, on_delete=models.CASCADE, blank=True)
      #items = models.ManyToManyField(OrderItem,blank=True, null=True,related_name=&quot;order_items&quot;)
      #start_date = models.DateTimeField(auto_now_add=True)
      order_status = models.CharField(max_length=50,choices=ORDER_STATUS,default='To_Ship')
  
      ordered_date = models.DateTimeField(auto_now_add=True)
      ordered = models.BooleanField(default=False)
      total_price = models.CharField(max_length=50,blank=True,null=True)
      #billing_details = models.OneToOneField('BillingDetails',on_delete=models.CASCADE,null=True,blank=True,related_name=&quot;order&quot;)
  
      def __str__(self):
          return self.user.email
  
      class Meta:
          verbose_name_plural = &quot;Orders&quot;
          ordering = ('-id',)
  
  class OrderItem(models.Model):
      #user = models.ForeignKey(User,on_delete=models.CASCADE, blank=True)
      order = models.ForeignKey(Order,on_delete=models.CASCADE, blank=True,null=True,related_name='order_items')
      item = models.ForeignKey(Product, on_delete=models.CASCADE,blank=True, null=True)
      order_variants = models.ForeignKey(Variants,on_delete=models.CASCADE,blank=True,null=True)
      quantity = models.IntegerField(default=1)
      total_item_price = models.CharField(max_length=50,blank=True,null=True)
  
  
      def __str__(self):
          return f&quot;{self.quantity} items of {self.item} of {self.order.user}&quot;
  
      class Meta:
          verbose_name_plural= &quot;Cart Items&quot;
          ordering = ('-id',)
  </code></pre>
  <p>My views:</p>
  <pre><code>class SellerOrderAPIView(ListAPIView):
      permission_classes = [AllowAny]
      serializer_class = OrderItemSerializer
  
      def get_queryset(self):
          merchant = get_object_or_404(Seller,self.kwargs['pk'])
          return OrderItem.objects.all(item__merchant=merchant)
  </code></pre>
  <p>My serializers:</p>
  <pre><code>class OrderItemSerializer(serializers.ModelSerializer):
      order_variants = VariantSerializer(read_only=True)
      #order_variants =VariantSerializer()
      item = ProductSerializer(read_only=True)
      class Meta:
          model = OrderItem
          fields = ['id','order','item','order_variants', 'quantity']
          # depth = 1
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Pd5tk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pd5tk.jpg" alt="enter image description here" /></a></p>
  <p>Here, I saw that when I see the orderdetails, merhchant is inside item, that's why I tried filtering the queryset using item__merchant=merchant, but I got this error.</p>
  <p>My urls:</p>
  <pre><code>path('api/merchantorder/&lt;int:pk&gt;', views.SellerOrderAPIView.as_view(), name='api-merchant-orderdetail'),
  </code></pre>