Am having a Flask app which receives json data.This is the json format defined in views.py.
Values = [
{
'Count':0,
'RPM':0,
'ECT':0
},
{
'Count':1,
'RPM':1,
'ECT':1
}
]
Each updates json data is passed to html also as argument
@app.route("/members")
def members():
return render_template("members.html",VALS=Values)
Inside the html page the json data is treated like this
{% for VAL in VALS %}
{% if (VAL['ECT'] > 251) %}
<h1> -> RPM:,ECT:{{VAL.ECT}} <button type="button" class="btn btn-danger btn-sm">High</button> </h1>
{% else %}
<p> {{VAL.Count}} -> RPM:{{VAL.RPM}},ECT:{{VAL.ECT}} <button type="button" class="btn btn-success btn-md">Normal</button> </p>
{% endif %}
{% endfor %}
I am facing problems with checking condition in if.The condition
{% if (VAL['ECT'] > 251) %}
is not working. How can i solve this?