title: Django Foreign Key Model Error
body: <p>I Created Two models "<strong>Restaurantmenu</strong>" and "<strong>Cart</strong>", Where Restaurantmenu.Product_id is Primary key and Cart.prdct_id is Foreign key.
  Migration is done without any error. But when I insert data in the Cart then I got an error:</p>
  
  <p>ValueError: Cannot assign "'4359197'": "Cart.prdct_id" must be a "Restaurantmenu" instance.</p>
  
  <p>Find the Model File:</p>
  
  <pre><code>class Restaurantmenu(models.Model):
     product_id = models.BigIntegerField(primary_key=True)
     shopid = models.CharField(max_length=50)
     prod_type = models.CharField(max_length=50,null=True)
     prd_category = models.CharField(max_length=50,null=True)
     prd_name = models.CharField(max_length=100,null=True)
     prd_amt = models.FloatField(null=True)
     prod_desc = models.CharField(max_length=200,null=True)
     offer = models.FloatField(null=True,default=0)
     offer_type= models.CharField(max_length=50,null=True,default='None')
    status = models.BooleanField(default=1)
    image = models.CharField(max_length=200)
    created_date = models.DateTimeField(auto_now_add=True)
    modified_date = models.DateTimeField(auto_now = True)
  
    def __unicode__(self):
      return self.product_id
  
  class Cart(models.Model):
    cart_id = models.BigIntegerField(null=True)
    cust_id = models.IntegerField(null=True)
    prdct_id = models.ForeignKey(Restaurantmenu,on_delete=models.DO_NOTHING)
    no_of_quantity = models.IntegerField(null=True)
    total_amt = models.FloatField(null=True)
    status = models.CharField(max_length=50,null=True)
    created_date = models.DateTimeField(auto_now_add=True)
    modified_date = models.DateTimeField(auto_now=True)
  
    def __unicode__(self):
      return self.cart_id
  </code></pre>
  
  <p>Its REST API View:</p>
  
  <pre><code>def addcart(self,requestobj,cart_amt):
      cartid = self.generate_cart_id(7)
      print(type(int(requestobj['pid'])))
      try:
          cartobj,cartcreate = Cart.objects.get_or_create(
                  cart_id = cartid,
                  cust_id = requestobj['Userid'],
                  prdct_id= int(requestobj['pid']),
                  defaults={
                      'no_of_quantity':requestobj['quantity'],
                      'total_amt': cart_amt,
                      'status':'Pending'
                  }
              )
          if cartcreate:
              response = {"Status":"Success","Message":"Added to the cart","code":"200"}
          else:
              response = {"Status":"Error","Message":"Not Added, Try Again","code":"100"}
      except MultipleObjectsReturned:
          response =  {"Status":"Error","Message":"Cart Already Exist","code":"100"}
      return response 
  
  def generate_cart_id(self,len):
      cartid = ""
      for i in range(len):
          rnd_nbr = str(random.randint(1,9))
          cartid+=str(rnd_nbr)
      return cartid   
  </code></pre>