'Accessing key-value on FLASK/JINJA
So my back-end is delivering this to the front:
"results": [
{
"id": 166740,
"usuario": {
"id": 64600,
"operations": [
{
"value": 1000.0,
"data": "20/04/2022 18:06",
"status": "1",
"expired": true,
},
{
"value": 1000.0,
"data": "20/04/2022 18:17",
"status": "6",
"expired": false,
}
]}
How can I loop through it and acccess expired and status? I started with:
<script id="tpl__report_apoios" type="text/x-jsrender">
{% raw %}
{^{for results}}
on my flask app but anything after that wont work
Solution 1:[1]
Something like:
{% for result in results %}
{% result.status %}
{% result.expired %}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aristotle |
