{% for frequency in patient_meds.frequency %}
{% if frequency == "7" %}
<td>Hellow</td>
{% endif %}
{% endfor%}
getting error
TemplateSyntaxError: 'if' statement improperly formatted
i don't know what i have to do please help me...
If you're using the default version of Django included with app engine (v0.96), then try this syntax:
{% for frequency in patient_meds.frequency %}
{% ifequal frequency "7" %}
<td>Hellow</td>
{% endif %}
{% endfor%}
In order to be able to use the ==
syntax in the {% if %}
statement, you need to use Django 1.2 or above.
Django 1.2 comes with your GAE SDK, but 0.96 is loaded by default.
You can use version 1.2 of django , by declaring the version of the third-party library you want to use with the use_library()
function provided by the google.appengine.dist
package. Just put this code at the very top of your python file (at least before importing anything from django:
from google.appengine.dist import use_library
use_library('django', '1.2')
This way, your template should render nicely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With