title: View each result of a query with Jinja , python
body: <p>After a query is executed in my collection named 'patients' in mongodb: I have this code as a result that is named <code>patient_doc</code>:</p>
  
  <pre><code>{ "_id" : "5576ee2e1a6d6d0d9b879095", "date_of_birth" : "29/06/2015", "diagnosis" : "Mamografia", "doctor_id" : "554b6e791a6d6d34cc3272f7", "name" : "Xona", "sex" : "Female", "surname" : "Krasniqi" }
  { "_id" : "5576ee2e1a6d6d0d9b879095", "date_of_birth" : "29/06/2015", "diagnosis" : "Ekografia", "doctor_id" : "554b6e791a6d6d34cc3272f7", "name" : "John", "sex" : "Male", "surname" : "Esma" }
  </code></pre>
  
  <p>I render a template that contains a table:</p>
  
  <pre><code>return render_template('patient-record.html', patient_doc=doc)
  </code></pre>
  
  <p>In the browser i have only one patient displayed , how can i use jinja syntax to view all results. I mean how can I do a loop that will display data for each patient in my case. I tried <code>{% for patient_doc in patient_doc %}</code> but no result.</p>
  
  <p>Html file named patient-record.html contain this code:</p>
  
  <pre><code>   &lt;table class="patient-view-table"&gt;
      &lt;tr&gt;
        &lt;td class="property-name-col"&gt;Name:&lt;/td&gt;
        &lt;td class="property-value-col"&gt;{{ patient_doc.name }}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="property-name-col"&gt;Surname:&lt;/td&gt;
        &lt;td class="property-value-col"&gt;{{ patient_doc.surname }}&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td class="property-name-col"&gt;Sex:&lt;/td&gt;
        &lt;td class="property-value-col"&gt;{{ patient_doc.sex }}&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td class="property-name-col"&gt;Date of birth:&lt;/td&gt;
        &lt;td class="property-value-col"&gt;{{patient_doc.date_of_birth}}      
    &lt;/td&gt;    
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class="property-name-col"&gt;Diagnosis:&lt;/td&gt;
      &lt;td class="property-value-col"&gt;{{ patient_doc.diagnosis }}&lt;/td&gt;
     &lt;/tr&gt;
     &lt;/table&gt;
  </code></pre>
  
  <p>Can any body help me to solve this?</p>