title: Django how to render a queryset within a list to html
body: <p>I am trying to pass multiple querysets that I can use in rendering HT</p>
  
  <pre><code> context['date']=today_date
   context['doctor_list']=doctor_list
   context['appointment_list']= all_data_doctor
   context['slots'] = slots
   return(context)
  </code></pre>
  
  <p>I am able to parse all context components (date, doctor_list and slots) except appointment_list because it is a list with a queryset within it. Here is an example</p>
  
  <pre><code>['', '', '', '', &lt;QuerySet [{'first_name': 'Emily', 'last_name': 'Johns'}]&gt;, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
  </code></pre>
  
  <p>Here is what I am doing but does not seem to work. </p>
  
  <pre><code>&lt;tbody&gt;
  {% for appt in appointment_list %}
   &lt;tr&gt;
    {% if appt %}
     &lt;td&gt;{{ appt.first_name }} {{ appt.last_name }}&lt;/td&gt;
     {% else %}
     &lt;td&gt; Empty &lt;/td&gt;
    {% endif %}
   &lt;/tr&gt;
  {% endfor %}
  &lt;/tbody&gt;
  </code></pre>
  
  <p>What could be the problem? And also, is this a good way to do it? 
  Thanks</p>