Reputation: 482
<div class = "col-lg-2">
<div class = "shadow card text-center">
{% for i in cart %}
{{i}} x {{req["{i}qty"]}}
Is there any possible way to pass a {{req["{i}qty]}}
And make it behave as if it is req[f'{i}qty']
in jinja2?
Upvotes: 2
Views: 761
Reputation: 201
Have you tried something like this?
{% for i in cart %}
{{i}} x {{req["{}qty".format(i)]}}
{% endfor %}
Upvotes: 3