title: How to assign foreign key related field while creating model objects
body: <p>I have model League one of its field <strong>country_code</strong> relate as foreign key to another model Country</p>
  
  <pre><code>class League(models.Model):                           
      league = models.IntegerField(primary_key=True)                                                   
      league_name = models.CharField(max_length=200)                                                   
      country_code = models.ForeignKey("Country",null=True, on_delete=models.SET_NULL)                 
  
  class Country(models.Model):                          
      country = models.CharField(max_length=60)
      code = models.CharField(max_length=15,null=True)
      flag = models.URLField(null=True)               
      lastModified = models.DateTimeField(auto_now=True)
  </code></pre>
  
  <p>When i am trying to create League object </p>
  
  <pre><code>data_json = leagues_json["api"]["leagues"]      
  for item in data_json:                                 
      league_id = item["league_id"]                   
      league_name = item["name"]                      
      country = item["country"]                                              
      b = League.objects.create(league = league_id,league_name = league_name,country_code = country)
  </code></pre>
  
  <p>I get en error:</p>
  
  <pre><code>ValueError: Cannot assign "'World'": "League.country_code" must be a "Country" instance.
  </code></pre>
  
  <p>Like i understand error occurs because while i am creating object i didn't assign to <code>country_code</code> field proper <code>Country</code> object.</p>
  
  <p>How to do it?</p>