title: django tables2 Join
body: <p>I wish to do several joins using tables2 in django</p>
  
  <pre><code> --- models.py (abbrev.)
  
  from django.db import models
  import django_tables2 as tables2
  
  class Architecture (models.Model):
      architecture_id = models.AutoField(primary_key=True)
      architecture_name = models.CharField("Architecture",max_length=20)
      architecture_comment =models.CharField("Comments",null=True,blank=True,max_length=200)
  
  class Server (models.Model):
      server_id  = models.AutoField(primary_key=True)
      server_name = models.CharField("Server Name",max_length=200,unique=True)
      server_ip = models.IPAddressField("Server IP")
      server_serial = models.CharField("Serial No.",max_length=25,null=True,blank=True)
      server_mem = models.PositiveIntegerField("Mem (MB)",null=True,blank=True)
      server_architecture = models.ForeignKey(Architecture)
  
  class ServersTable(tables2.Table):
      architecture = tables2.Column(accessor='architecture.architecture_name')
  
  
  --- views.py
  
  from django.http import HttpResponse
  from servers.models import Server
  from django.shortcuts import render
  
  def index(request):
      return render(request, "index.html", {"server": Server.objects.all()})
  
  --- index.html 
  {% load render_table from django_tables2 %}
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  
  &lt;link rel="stylesheet"     href="http://myhost/django_tables2/themes/paleblue/css/screen.css" /&gt;
  &lt;title&gt;myhost&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
   {% render_table server %}
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Results: </p>
  
  <p>in the Architecture column it shows .... "<strong>Architecture object</strong>" for each instance where there should be an architecture_name</p>
  
  <p>How can I get the "JOINS" to work ?
  Thanks. </p>