title: "unknown column X.id" error in django using existing DB
body: <p>I am trying to create a model for an existsing DB. Using the output of <code>manage.py inspectdb</code>, My <code>models.py</code> file looks like this:</p>
  
  <pre><code>from django.db import models
  
  ...some more stuff here...
  
  class Scripts(models.Model):
      run_site = models.ForeignKey(Sites, db_column='run_site')
      script_name = models.CharField(max_length=120)
      module_name = models.CharField(unique=True, max_length=120)
      type = models.CharField(max_length=24)
      cat_name = models.CharField(max_length=90)
      owner = models.ForeignKey(QAPeople, db_column='owner')
      only_server = models.CharField(max_length=120, blank=True)
      guest = models.IntegerField()
      registered = models.IntegerField()
      super = models.IntegerField()
      admin = models.IntegerField()
      run_timing = models.CharField(max_length=27)
      manual_owner = models.ForeignKey(QAPeople, db_column='manual_owner')
      script_id = models.IntegerField(unique=True,)
      version = models.IntegerField()
      comment = models.ForeignKey('ScriptComments', null=True, blank=True)
      class Meta:
          db_table = u'scripts'
  </code></pre>
  
  <p>When I try to do <code>Scripts.objects.all()</code> I get</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "C:\Python26\lib\site-packages\django\db\models\query.py", line 68, in __repr__
      data = list(self[:REPR_OUTPUT_SIZE + 1])
    File "C:\Python26\lib\site-packages\django\db\models\query.py", line 83, in __len__
      self._result_cache.extend(list(self._iter))
    File "C:\Python26\lib\site-packages\django\db\models\query.py", line 269, in iterator
      for row in compiler.results_iter():
    File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 672, in results_iter
      for rows in self.execute_sql(MULTI):
    File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 727, in execute_sql
      cursor.execute(sql, params)
    File "C:\Python26\lib\site-packages\django\db\backends\util.py", line 15, in execute
      return self.cursor.execute(sql, params)
    File "C:\Python26\lib\site-packages\django\db\backends\mysql\base.py", line 86, in execute
      return self.cursor.execute(query, args)
    File "C:\Python26\lib\site-packages\MySQLdb\cursors.py", line 173, in execute
      self.errorhandler(self, exc, value)
    File "C:\Python26\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
      raise errorclass, errorvalue
  OperationalError: (1054, "Unknown column 'scripts.id' in 'field list'")
  </code></pre>
  
  <p>Why does django think there should be a <code>scripts.id</code> column? How do I fix it <em>without</em> dropping the tables etc?</p>