Reputation: 53
I have a dictionary (created from a Pandas dataframe):
{'name': 'steve', 'info': [{'pipeline': 'product1, product2'}]}
and this is the jinja2 sintax in a .docx template:
{% for x in info %}
• {{x[‘pipeline’]}}
{%endfor%}
the output is:
• product1, product2
but I'd like to have:
• product1
• product2
I'm not able to iterate and separate the values of the "info" key.
Upvotes: 0
Views: 84
Reputation: 125
Seeing as the value of pipeline is a string you need to add info.split(',') to get [product1, product] as a list that you can iterate over
Upvotes: 1