title: Column closingevent.id doesn't exist LINE 1: SELECT "closingevent"."id", "closingevent"."owner", "closing
body: <p>I've a problem with my templates. I try to render the following template</p>
  
  <pre><code>{% if liste_column %}
  &lt;table&gt; 
      &lt;tr&gt;&lt;th&gt;Owner&lt;/th&gt;
          &lt;th&gt;RegimeID&lt;/th&gt;
          &lt;th&gt;ClosingeventID&lt;/th&gt;
          &lt;th&gt;Category&lt;/th&gt;
          &lt;th&gt;Transaction or Closing&lt;/th&gt;
          &lt;th&gt;**** Accounting Field&lt;/th&gt;
          &lt;th&gt;Data Source&lt;/th&gt;
      &lt;/tr&gt;
  
  {% for item in liste_column %}
      &lt;tr&gt;&lt;td&gt;{{item.owner}}&lt;/td&gt;
          &lt;td&gt;{{item.regimeid}}&lt;/td&gt;
          &lt;td&gt;{{item.closingeventid}}&lt;/td&gt;
          &lt;td&gt;{{item.category}}&lt;/td&gt;
          &lt;td&gt;{{item.transactionorclosing}}&lt;/td&gt;
          &lt;td&gt;{{item.****accountingfield}}&lt;/td&gt;
          &lt;td&gt;{{item.datasource}}&lt;/td&gt;
     &lt;/tr&gt;
  {% endfor %}
  &lt;/table&gt;
  {% else %}
      &lt;p&gt;No Data are available.&lt;/p&gt;
  {% endif %}
  </code></pre>
  
  <p>And get the error: </p>
  
  <pre><code>Column closingevent.id doesn't exist LINE 1: SELECT "closingevent"."id", "closingevent"."owner", "closing...
  </code></pre>
  
  <p>My table has no column which is called "closingevent"."id" and I even didn't try to get this. I get it for other templates too.</p>
  
  <p>Can you help me? I think it could be the problem that my model doesn't have a primary key and just a foreign key.</p>
  
  <pre><code>class Closingevent(models.Model):
      owner = models.CharField(max_length=800, blank=True, null=True)
      regimeid = models.ForeignKey('Regime', models.DO_NOTHING, 
      db_column='regimeid')
      closingeventid = models.FloatField()
      category = models.CharField(max_length=800, blank=True, null=True)
      closingevent = models.CharField(max_length=800, blank=True, null=True)
      transactionorclosing = models.CharField(max_length=1, blank=True, 
      null=True)
      ****accountingfield = models.CharField(max_length=1, blank=True, 
      null=True)
      datasource = models.CharField(max_length=800, blank=True, null=True)
      debitacoountnumber = models.CharField(max_length=800, blank=True,         
      null=True)
      debitsubitem = models.CharField(max_length=1, blank=True, null=True)
      debitaccountname = models.ForeignKey('Lineitemaccounting',     
      models.DO_NOTHING,db_column='debitaccountname', 
      blank=True,null=True,related_name='daccountname2')
      debitbalancesheet = models.CharField(max_length=1, blank=True, null=True)
      debitprofitandlose = models.CharField(max_length=1, blank=True, 
      null=True)
      debitreconciliation = models.CharField(max_length=1, blank=True, 
      null=True)
      creditaccountnumber = models.CharField(max_length=1, blank=True, 
      null=True)
      creditsubitem = models.CharField(max_length=1, blank=True, null=True)
      creditaccountname = models.ForeignKey('Lineitemaccounting', 
      models.DO_NOTHING, db_column='creditaccountname', blank=True, 
      null=True,related_name='caccountname2')
      creditbalancesheet = models.CharField(max_length=1, blank=True, 
      null=True)
      creditprofitandloss = models.CharField(max_length=1, blank=True, 
      null=True)
      creditreconciliation = models.CharField(max_length=1, blank=True, 
      null=True)
  
      class Meta:
          managed = False
          db_table = 'closingevent'
          unique_together = (('regimeid', 'closingeventid'),)
  </code></pre>