title: How to load Jinja2 template with values after form submission
body: <p>I have a form in a Jinja2 template. This is what I'm trying to do with it:</p>
  
  <ul>
  <li>After a user submits the form, a handler in the backend enqueues an
  asynchronous task. </li>
  <li>The handler then reloads the current page with the form filled
  with the user provided values.</li>
  </ul>
  
  <p>What is the best way to do this ?
  For example say I have a <code>&lt;select&gt;</code> input in my form that looks like this:</p>
  
  <pre><code>  &lt;select id="shift_selected" name="shift_selected"&gt;
    {% for shift in Shifts %}
      &lt;option value="{{ shift }}" {{ 'selected' if shift == selected_shift }}&gt;{{ shift }}&lt;/option&gt;
    {% endfor %}
    &lt;/select&gt;
  </code></pre>
  
  <p>Now to re render the page after the form has been submitted,</p>
  
  <ul>
  <li><p>my handler has to parse the input, get the value of 'shift_selected'</p></li>
  <li><p>Then set the value of 'selected_shift'.</p></li>
  </ul>
  
  <p>args['selected_shift'] = self.request.get("selectedShift")</p>
  
  <p>template.render(args) </p>
  
  <p>The handler essentially receives some data in form    values and    sends the same data back as a template variable value. Is    there a    better way to do this. If done for a long form this method is quite tedious.</p>