title: Django loaddata with Natural Keys not querying correct Foreign Key
body: <p>Here is my problem. I am trying to load some data that has a natural key relationship to another model.   </p>
  
  <p>I modified the parent model to generate natural keys.</p>
  
  <p>I exported the the data from the old database using the command:</p>
  
  <pre><code>manage.py dumpdata resources.image -n --indent 4 &gt; images.json
  </code></pre>
  
  <p>I then tried to import into the new database  using the command:</p>
  
  <pre><code>manage.py loaddata images.json
  </code></pre>
  
  <p>At this point I get the error:</p>
  
  <pre><code>IntegrityError: Problem installing fixtures: The row in table 'resources_image' 
  with primary key '340' has an invalid foreign key: resources_image.voyage_id contains 
  a value '41890' that does not have a corresponding value in voyage_voyage.id.
  </code></pre>
  
  <p>It is trying to query on voyage_voyage.id  instead of voyage_voyage.voyage_id as specified in the get_by_natural_key function.  I double checked and the key in the fixture is in the voyage_id field. Below is my code and sample fixture.</p>
  
  <p>Parent Model:</p>
  
  <pre class="lang-py prettyprint-override"><code># for parsing natural key
  class VoyageManager(models.Manager):
      def get_by_natural_key(self, voyage_id):
          return self.get(voyage_id=voyage_id)
  
  
  class Voyage(models.Model):
  
      # for parsing natural key
      objects = VoyageManager()
  
  
      voyage_id = models.IntegerField("Voyage ID (can be empty)", null=True, blank=True)
  
      # A WHOLE BUNCH OF FIELDS
  
      # generate natural key
      def natural_key(self):
          return (self.voyage_id)
  
  
      class Meta:
          ordering = ['voyage_id',]
          verbose_name = 'Voyage'
          verbose_name_plural = "Voyages"
  
      def __unicode__(self):
          return "Voyage #%s" % str(self.voyage_id)
  </code></pre>
  
  <p>Child Model:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Image(models.Model):
      voyage = models.ForeignKey(Voyage, null=True, blank=True)
  
      # MANY OTHER FIELDS
  
      class Meta:
          verbose_name = "Image"
          verbose_name_plural = "Images"
  
          ordering = ["date"]
  </code></pre>
  
  <p>The Fixture:</p>
  
  <pre class="lang-py prettyprint-override"><code>{
      "pk": 340, 
      "model": "resources.image", 
      "fields": {
          "category": 56, 
          "voyage": 41890, 
          "date": 1873, 
          "description": "blah blah blah", 
          "language": "  ", 
          "creator": null, 
          "title": "Catherine Zimmermann-Mulgrave, \nc.1873", 
          "source": "blah blah blah", 
          "ready_to_go": true, 
          "file": "images/5AF81DA065049ACE0EC8E236C445F5BC.JPG", 
          "order_num": 0
      }
  }
  </code></pre>