title: Django model instance from foreign key
body: <p>I am reading Excel using xlrd.  One of the columns has the Bank name, which is linked to vehicle model via Foreign Key.  When xlrd finishes reading a row, it should save that record to vehicle table.  However getting the actual pk value and error that Vehicles.bank must a Banks instance.</p>
  
  <p>After checking dozens of questions related to this issue, I found this <a href="https://stackoverflow.com/questions/18790534/">one</a> the most similar one, but still I am not getting the expected result.</p>
  
  <p>The relevant Vehicle model section is as follows:</p>
  
  <pre><code>class Vehicles(models.Model):
      stock = models.CharField(max_length=10, blank=False, db_index=True)
      vin = models.CharField(max_length=17, blank=False, db_index=True)
      sold = models.DateField(blank=True, null=True, db_index=True)
      origin = models.CharField(max_length=10, blank=False, db_index=True)
      bank = models.ForeignKey('banks.Banks', db_column='bank', null=True)
  </code></pre>
  
  <p>I am using python 2.7, django 1.5.4 and Postgresql 9.2.5.  Dbshell utility does show that banks table has a Foreign contraint referring to vehicles table, via banks(id).</p>
  
  <p>Since I am not using a form for this particular part, I think it does not matter whether I use a ModelForm or not.</p>
  
  <p>Current scenario: Excel file has FBANK as the cell value.  There is an existing record in banks table that contains FBANK in its name column, id=2.  The python line is:</p>
  
  <pre><code>def bank(value):
      return Banks.objects.get(name=value).id
  </code></pre>
  
  <p>With the above line, error is:
  Cannot assign "2": "Vehicles.bank" must be a "Banks" instance.</p>
  
  <p>If I remove the ".id" at the end, error is then:
  Banks matching query does not exist.</p>
  
  <p>Appreciate your help.
  Ricardo</p>