title: formatting and use of dictionaries in jinja2 templates
body: <p>I'm trying to add dictionaries <code>form_label</code> and <code>form_field</code> to this macro call, and it's not going so well.</p>
  
  <p>From the template. Only the macros line is really pertinent to the question.
  Let me repeat.  <strong>Only the macros line is really pertinent to the question.</strong></p>
  
  <pre><code>{% block content %}
  &lt;div id="edit_profile" class="well-lg"&gt;
    &lt;fieldset&gt;
      &lt;form id="form_edit_profile" class="form-horizontal" action="{{ url|safe }}" method="post"&gt;
         &lt;input type="hidden" name="_csrf_token" value="{{ csrf_token() }}"&gt;
         {{ macros.field(form.username, label=_("Username"), form_label={class:"col-xs-2"}, form_field={'placeholder':_("Enter your")+" "+_("Username"), class:"form-control focused required"}) }}
         ...
  </code></pre>
  
  <p>and the macro to support it.  (has been updated because I didn't pass class as a string the first time.)</p>
  
  <pre><code>{% macro field(field, label='', form_label={},form_field={}) -%}
          &lt;div class="form-group{% if field.errors %} error{% endif %}"&gt;
              {% set text = label or field.label.text %}
  
              {% if field.flags.required %}
                      {{ field.label(text=text + " *", class='control-label '+form_label['class'])}}
              {% else %}
                      {{ field.label(text=text + " ", class='control-label '+form_label['class']) }}
              {% endif %}
              &lt;div class='col-xs-5'&gt;
              {{ field(label, **form_field) }}
              {% if field.errors %}
                  {% for error in field.errors %}
                     &lt;label for="{{ field.id }}" class="error help-inline"&gt;{{ error }}&lt;/label&gt;
                  {% endfor %}
              {% endif %}
              &lt;/div&gt;
          &lt;/div&gt;
  {%- endmacro %}
  </code></pre>
  
  <p>I'm wondering if I'm referencing the variables incorrectly or if the dictionary keys should be strings or something I'm not considering.</p>
  
  <p>updated the traceback.</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1535, in __call__
      rv = self.handle_exception(request, response, e)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1529, in __call__
      rv = self.router.dispatch(request, response)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
      return route.handler_adapter(request, response)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 1102, in __call__
      return handler.dispatch()
    File "/Users/me/Documents/Aptana Studio 3 Workspace/project/bp_includes/lib/basehandler.py", line 89, in dispatch
      webapp2.RequestHandler.dispatch(self)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 572, in dispatch
      return self.handle_exception(e, self.app.debug)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py", line 570, in dispatch
      return method(*args, **kwargs)
    File "/Users/me/Documents/Aptana Studio 3 Workspace/project/bp_includes/handlers.py", line 112, in get
      return self.render_template('login.html', **params)
    File "/Users/me/Documents/Aptana Studio 3 Workspace/project/bp_includes/lib/basehandler.py", line 325, in render_template
      self.response.write(self.jinja2.render_template(filename, **kwargs))
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2_extras/jinja2.py", line 158, in render_template
      return self.environment.get_template(_filename).render(**context)
    File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 894, in render
      return self.environment.handle_exception(exc_info, True)
    File "bp_content/themes/default/templates/login.html", line 1, in top-level template code
      {% extends base_layout %}
  TypeError: macro 'field' takes no keyword argument 'placeholder'
  </code></pre>