私は2つの変数 "test"を持つ{{ profile }}
と "test"という値を持つ{{ element.author }}
を持っているとします。 jinja2では、ifを使って比較しようとすると、何も表示されません。私は次のような比較を行います。は2つの変数をjinja2テンプレートと比較します
{% if profile == element.author %}
{{ profile }} and {{ element.author }} are same
{% else %}
{{ profile }} and {{ element.author }} are **not** same
{% endif %}
私は出力test and test are not same
いただきました間違って、どのように私は比較することができますを取得しますか?
{{[profile、element.author]}} – defuz
の値を入力してください。この式は変数の表現を取るべきです。 – defuz