Reputation: 1514
I am trying to render an html like below in jinja2
<div>
<tr>
<td>{{ row.a|add:b}}</td>
</tr>
</div>
it throws error expected token 'end of print statement', got ':'
. Above html was written for django template language. can someone help me with right substitute for jinja2?
Upvotes: 1
Views: 191
Reputation: 46
You can use sum
filter in jinja2
In your case [a,b]|sum
should work
Check this: https://jinja.palletsprojects.com/en/2.11.x/templates/#sum
Upvotes: 2