title: Foreign key relationship error in django
body: <p>I am developing a django app where I use a legacy database. This database doesn't have primary key or constraint in any table. This are two of my models</p>
  
  <pre><code>class Provider(models.Model):
      id_provider = models.IntegerField(blank=True, null=True, primary_key=True)
      name = models.CharField(max_length=50, blank=True)
      type = models.CharField(max_length=10, blank=True)
      signed = models.CharField(max_length=15, blank=True)
      currency = models.CharField(max_length=1, blank=True)
      class Meta:
          managed = False
          db_table = 'mpc_proveedores'
  
  class Master(models.Model):
      id_provider = models.ForeignKey(Proveedor)
      anio = models.IntegerField(blank=True, null=True)
      mes = models.IntegerField(blank=True, null=True)
      nombre_prov = models.CharField(max_length=50, blank=True)
      tipo_conci = models.CharField(max_length=30, blank=True)
      f_recepcion = models.DateField(blank=True, null=True)
      e_recepcion = models.IntegerField(blank=True, null=True)
      class Meta:
          managed = False
          db_table = 'mpc_master'
  </code></pre>
  
  <p>I need to show a table based on the model Master and I need to display the name of the provider instead of the id_provider.</p>
  
  <p>This is my view</p>
  
  <pre><code>def monitorViewV2(request):
      table = MonitorTable(Master.objects.all())
      RequestConfig(request).configure(table)
      return render(request,'monitorv2.html',{'table': table})
  </code></pre>
  
  <p>When I try to see the template in the browser, the next error is showed</p>
  
  <blockquote>
    <p>ORA-00904: "MPC_MASTER"."ID_PROVIDER_ID": invalid identifier</p>
  </blockquote>
  
  <p>I don't know if the error is because I don't have relationships in the database or if I need to create a function in the view to display the name instead of the id_provider.
  Can you bring me some snippet or link where I can take some ideas to resolve this issue</p>
  
  <p>Thanks in advance</p>