title: How to display multiple tables in one view using django-tables2?
body: <p>Using djt2 v0.15/dj1.6/pyth2.6.6</p>
  
  <p>djt2 doc example views file for multiple tables:</p>
  
  <pre><code>def people_listing(request) :
  
      config = RequestConfig(request)
      table1 = PeopleTable(Person.objects.all(), prefix="1-")
      table2 = PeopleTable(Person.objects.all(), prefix="2-")
      config.configure(table1)
      config.configure(table2)
      return render(request, "people_listing.html",
          {"table1": table1, "table2": table2})
  </code></pre>
  
  <p>This example first of all seems incorrect as to the quoted "table1", "table2" parameters.  My tests show the the definition name "people_list" needs to be used in the quotes, at least on a single table.  Besides why would anyone want to display the same table twice?  Is this a bad example?  Here is my app trying to use this structure:</p>
  
  <pre><code>def AvLabVw(request):
  
      config = RequestConfig(request)
      cmutbl = CmuTable(CmuVersion.objects.all(), prefix="1-")
      simtbl = SimTable(Simulator.objects.all(), prefix="2-")
      config.configure(cmutbl)
      config.configure(simtbl)
      return render(request, "AvRelInfo.html", {"AvLabVw":cmutbl, "AvLabVw":simtbl})
  </code></pre>
  
  <p>The url file picks up on AvLabVw and the html template uses render_table.</p>
  
  <pre><code>{% render_table AvLabVw %}
  </code></pre>
  
  <p>What happens with this code is only one table is still displayed, whichever is last on the return render  line.</p>
  
  <p>Elsewhere in the doc it says SingleTableView with get_context_data needs to be used, which I haven't figured out yet...</p>
  
  <p>I have an attempt on this style implementation, I think it needs a table object and a list object?</p>
  
  <h2>views.py</h2>
  
  <pre>
  from django_tables2 import views
  from django_tables2 import SingleTableView
  from django_tables2 import SingleTableMixin
  from django.shortcuts import render
  from django_tables2   import RequestConfig
  
  def SimVers_lst(request):
  
       return render(request, 'AvRelInfo.html', {'SimVers_lst' : Simulator.objects.all()})
  
  def AvLabVw(request):
  
      config = RequestConfig(request)
      simlst = SimVers_lst(Simulator.objects.all())
      table = CmuTable(CmuVersion.objects.all(), prefix="1-")
      Stv = views.SingleTableView()
      multitbl = Stv.get_context_data()
      config.configure(multitbl)
      return render(request, "AvRelInfo.html", { "AvLabVw" : multitbl })
  </pre>
  
  <p>barfs at <code>{% render_table AvLabVw %}</code> in the html template with the usual catch-all
  <code>"ValueError at /AvCtlapp/  Expected table or queryset, not 'str'."</code>
  ... getting some garbage...  I guess I can try to see what it gets in a shell if I can set up that test...</p>
  
  <p>Thanks for any help...</p>
  
  <p>Joe</p>
  
  <p>PS: Is a custom render needed, and how would that look?</p>