How to select some keys in a dictionary in jinja2 when iterating over them
<p>I have a dictionary like this</p>

<pre><code>[ { 'a' : "Aa1",
    'b' : "Bb1",
    'c' : "Cc1"
  } ,

  { 'a' : "Aa2",
    'b' : "Bb2",
    'c' : "Cc2"
    'd' :"Dd2"
 } ]
</code></pre>

<p>I want to reject some keys while looping through this array of dictionaries. So I want result something like</p>

<p><strong>reject key "a" and "b"</strong></p>

<pre><code>c = Cc1

c = Cc2
d = Dd2
</code></pre>

<p>How can I accomplish that</p>

<p>I have tried something like this</p>

<pre><code>{ % for dict in dictionaries % }
     {%- for key,value in dict.items()%}
        {%- if key|rejectattr("a", "b") %}
          {{key}} = {{value }}
        {%- endif%}    
    {% endfor %}
{% endfor % }
</code></pre>

<p>However this does not work. Any suggestions.</p>