title: Queryset contenttype show fields name and values in template table
body: <p>I got a view that receives a model and field the user passes via post (existing model and field inside the app of course) and makes a queryset filter on it, then i need to show in my template that result in a table (name fields must be the column headers) and their respective values.</p>
  
  <p>This what i got so far trying to serialize the queryset result in order to make it easier to show in template:</p>
  
  <p>Views.py:</p>
  
  <pre><code>from django.contrib.contenttypes.models import ContentType
  
  class CommitteeReport(BaseView):
  
  template_name = 'committee/committee_report.html'
  
  def post(self, request, **kwargs):
      myfield = request.POST['field'].lower()
      my_model = request.POST['model'].lower()
      queryset_obj = ContentType.objects.get(model = my_model).model_class().objects.filter(**{myfield:True})
  
      return render(request, self.template_name,{
          'requirements': queryset_obj,
      })
  </code></pre>
  
  <p>And my template:</p>
  
  <pre><code>        &lt;div class="tab-pane active" id="tab_1"&gt;
              &lt;table class="datatable table table-striped table-hover" cellspacing="0"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          {% for key in requirements %}
                              &lt;th&gt;{{ key.fields.name }}&lt;/th&gt;
                          {% endfor %}
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      {% for item in requirements %}
                          &lt;tr&gt;{{ item.fields.value }}&lt;/tr&gt;
                      {% endfor %}
                  &lt;/tbody&gt;
              &lt;/table&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>Thing is, i don't get result or if i change the tag inside the template, i get the objects dictionary for every row.</p>
  
  <p>Any idea of how to achieve what i need ?, thanks in advance.</p>