title: problem with a field that expected a number but got another thing
body: <p><a href="https://i.stack.imgur.com/zRIjD.png" rel="nofollow noreferrer">this is the error</a>
  im using django 4.0.2 and making a cart but when i make the check out, i get this error
  any suggestion to make it work?
  i appreciate your help</p>
  <p>i have in checkout.py this code</p>
  <pre><code>class Checkout(LoginRequiredMixin, View):
  
      def post (self, request):
          addres = request.POST.get('addres')
          comment = request.POST.get('comment')
          cart = request.session.get('cart')
          user= request.session.get('user')
          product = Product.get_product_by_id(cart)
          print(addres, comment, User, cart, product )
  
  
          for product in product:
  
              print(cart.get(str(product.id)))
  
              order = Order(user_id=user,
                            product=product,
                            price=product.price,
                            addres=addres,
                            comment=comment,
                            quantity=cart.get(str(product.id)))
              order.save()
  
          request.session['cart'] = {}
  
  
          return redirect ('cart:cart_detail')
  </code></pre>
  <p>#i have a cart.py code to that have some values, but i can't see where is the problem
  i'm following some tutorials to do this code.
  my cart.py</p>
  <pre><code>    from django.conf import settings
  
  from product.models import Product
  
  
  class Cart(object):
      def __init__(self, request):
          self.session = request.session
          cart = self.session.get(settings.CART_SESSION_ID)
  
          if not cart:
              cart = self.session[settings.CART_SESSION_ID] = {}
          
          self.cart = cart
  
  
      def add(self, product):
          if str(product.id) not in self.cart.keys():
              self.cart[product.id]={
                  &quot;product_id&quot;: product.id,
                  &quot;title&quot;:product.title,
                  'quantity': 1, 'id': int(product.id),
                  &quot;image&quot;:product.image.url,
                  &quot;thumbnail&quot;:product.thumbnail.url,
                  &quot;price&quot;: str(product.price)
                  
              }
          else:
              for key, value in self.cart.items():
                  if key== str(product.id):
                      value[&quot;quantity&quot;] = value[&quot;quantity&quot;]+ 1
                      break 
          
          self.save()
  
      def save(self):
          self.session[&quot;cart&quot;] = self.cart
          self.session.modified = True
  
  
      def remove(self, product):
          product_id = str(product.id)
          if product_id in self.cart:
              del self.cart[product_id]
              self.save()
  
      def decrement(self, product):
          for key, value in self.cart.items():
              if key == str(product.id):
                  value[&quot;quantity&quot;] = value[&quot;quantity&quot;]- 1
                  if value[&quot;quantity&quot;] &lt; 1:
                      self.remove(product)
                  else:
                      self.save()
                  break
              else:
                  print(&quot;the item does not exist in the cart&quot;)
                  
      
  
      def clear(self):
          self.session[&quot;cart&quot;] = {}
          self.session.modified = True
  
   
  </code></pre>
  <pre><code>this is my user model 
  
  from enum import unique
  from statistics import mode
  from django.conf import settings
  from django.db import models
  from django.contrib.auth.models import AbstractUser
  
  from limpiaC.settings import MEDIA_URL, STATIC_URL
  
  
  
  
  class Gender(models.Model):
      name = models.CharField(max_length=255)
  
  
      def __str__(self):
          return self.name 
      
  
  class User(AbstractUser):
  
  
      identification = models.CharField(max_length=255, unique=True)
      image = models.ImageField(upload_to='profile_uploads/', blank=True, null=True,default='images/defaultProfile.jpg')
      gender = models.ForeignKey(Gender, related_name='genders', on_delete=models.CASCADE)
      company = models.CharField(max_length=255)
      state = models.CharField(max_length=255)
      zip = models.CharField(max_length=255)
      description = models.TextField(blank=True, null=True)
      date_added = models.DateTimeField(auto_now_add=True)
      dateofbirth = models.DateField
  
      def get_image(self):
          if self.image:
              return '{}{}'.format(MEDIA_URL, self.image)
          return '{}{}'.format(STATIC_URL, 'images/defaultProfile.jpg')
  </code></pre>