title: Modifying dictionary attributes in jinja2
body: <p>Suppose I pass a dictionary to my jinja2 template.<br>
  In the view I have something like</p>
  
  <pre><code>d = {}
  #set other template stuff into d
  get_params['cri'] = 'time'
  get_params['order'] = 'asc'
  d['get_params'] = get_params
  return d
  </code></pre>
  
  <p>In the template I need to change the value of keys of get_params. The logical thing  </p>
  
  <pre><code>{% set get_params.cri='src' %}
  </code></pre>
  
  <p>fails with an error</p>
  
  <pre><code>TemplateSyntaxError: expected token '=', got '.'
  </code></pre>
  
  <p>My question is how do I modify the values passed to a dictionary in jinja2</p>
  
  <p>(This question has been asked <a href="https://stackoverflow.com/questions/2703013/how-can-i-modify-merge-jinja2-dictionaries">here</a>, but I find the answer confusing and it only answers the merging part)</p>
  
  <p><strong>Answer EDIT:</strong></p>
  
  <p>Jinja2 provides the 'do' extension. To add that extension to pyramid, do the following in the <code>__init__.py</code> file</p>
  
  <pre><code>#This line is alreadythere
  config.include('pyramid_jinja2')
  #Add this line
  config.add_jinja2_extension('jinja2.ext.do')
  </code></pre>
  
  <p>In the template</p>
  
  <pre><code>{% do get_params.update({'cri':'src'}) %}
  </code></pre>