gqli
gqli

Reputation: 1045

How to join with equal sign and add single quote to the integer in Jinja2

I have string variable k = 'level' and an integer variable v = 4.

Is there an easy way to output level='4' in jinja1/2 ?

I tried with Join. Obviously, it won't work and I wish to add the single quote to the integer.

{{ [k, v]|join('=') }}

Upvotes: 0

Views: 113

Answers (1)

Damião Martins
Damião Martins

Reputation: 1849

You can try like this:

{{ k }}='{{ v }}'

Upvotes: 1

Related Questions