title: Django 2 function calls - 2 different results
body: <p>When I call the first function, there are no errors. When I call the second function, I get the error:
  <strong>Field 'id' expected a number but got &lt;Product: Hoodie adidas (Clothes)&gt;</strong>.</p>
  <p>How is this possible?</p>
  <p>First function:</p>
  <pre><code>Basket.objects.filter(user=current_user,
                        product=_get_product_by_id(product_id=product_id))
  
  </code></pre>
  <p>Second function:</p>
  <pre><code>def _is_user_have_product_in_basket_by_id(user: str, 
                                            product_id: any) -&gt; bool:
      return len(Basket.objects.filter(user=user,
                                       product_id=_get_product_by_id(product_id=product_id))) == 0
  </code></pre>
  <p>Additional function</p>
  <pre><code>def _get_product_by_id(product_id: int) -&gt; int:
      return Product.objects.get(id=product_id)
  </code></pre>