title: Django to_field not working
body: <p>I have two tables <code>RoomPriceDetails</code> and <code>HotelDetails</code>. <code>RoomPriceDetails</code> has a foreign key which I want to point to the primary key field named <code>hotel_id</code> of <code>HotelDetails</code>. I used <code>to_field</code> attribute for this, but it seems I am going wrong some where. It shows me error like </p>
  
  <blockquote>
    <p><strong>ValueError: invalid literal for int() with base 10: 'BMH-1'</strong>.</p>
  </blockquote>
  
  <p>when I try to add the <code>hotel_id</code> 'BMH-1' in <code>RoomPriceDetails</code>. 'BMH-1'is a hotel id in <code>HotelDetails</code>. If I am wrong what is the best way to make my foreign key to point to my <code>hotel_id</code> field in <code>HotelDetails</code> to accept those values.</p>
  
  <p>My models:</p>
  
  <pre><code>class RoomPriceDetails(models.Model):
      room_type = models.CharField(max_length=255, primary_key=True)
      hotel = models.ForeignKey(HotelDetails, to_field='hotel_id')
      price_per_day = models.PositiveIntegerField(default=0)
  
  class HotelDetails(models.Model):
      hotel_id = models.AutoField(primary_key=True, db_column='hotel_id')
      name = models.CharField(max_length=255)
      email = models.CharField(max_length=255)
      reg_no = models.CharField(max_length=255)
      contact_no = models.CharField(max_length=10)
      owner_name = models.CharField(max_length=255)
      owner_email = models.CharField(max_length=255)
      owner_contact_no = models.CharField(max_length=255)
      address = models.CharField(max_length=400)
      city = models.CharField(max_length=255)
      state = models.CharField(max_length=255)
      pincode = models.CharField(max_length=6)
  </code></pre>