t = Template(" my name is {{ my_name }}")
c = Context({ "my_name": patient.name })
//(like patient.age,patient.height.......... i want to display 8 fields of form in my datatable.)
d = t.render(c)
I want to display the template value in datatable. Here is my HTML code, where I'm trying but could getting exactly. Please help.
{% for patient in PatientInfo %}
<tr><td>{{patient.name }}</td>
<td>{{patient.uhid }}</td>
<td>{{patient.age }}</td>
<td>{{patient.gender }}</td>
<td>{{patient.height }}</td>
<td>{{patient.weight }}</td>
<td>{{patient.address }}</td>
<td>{{patient.phone_number }}</td></tr>
{% endfor %}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…