title: How to insert into a ForeignKey field using raw SQL?
body: <p>I've got tables like the following (Django model definition, with a postgres database underlying it):</p>
  
  <pre><code>class Person(models.Model):
      id = models.IntegerField(primary_key=True)
      name = models.CharField(max_length=300)     
  class Owner(models.Model):
      id = models.IntegerField()
      person = models.ForeignKey(Person) 
  </code></pre>
  
  <p>I use a Python script to set up my database from CSV files. The raw files list Owners with an integer id and an integer 'person' field, which maps to the integer in Person.id. </p>
  
  <p>However, given that the 'person' column in Owner expects a Person object, how do I write a raw SQL string to insert value into Owner?</p>
  
  <pre><code>owner_id = 665
  person_id = 330
  sql_string = 'INSERT INTO owner (id, person) VALUES (' +
  sql_string += owner_id + ', ' + ???? + ');'
  </code></pre>