title: rendering html title attributes with Flask-WTForms field description
body: <p>I am using the render_field macro presented on the <a href="http://flask.pocoo.org/docs/patterns/wtforms/" rel="noreferrer">Flask-WFT documentation page</a>  to render fields in long forms across different templates. </p>
  
  <p>A field is defined like this</p>
  
  <pre><code>year_built = IntegerField(label='Year Built', 
               description='Year built, not the year of a major renovation.',
               validators=[validators.NumberRange(
                                      min=1700,  
                                      max=2012, 
                                      message="Between %(min)s and %(max)s")])
  </code></pre>
  
  <p>The macro looks like this...</p>
  
  <pre><code>{% macro render_field(field) %}
    &lt;dt&gt;{{ field.label }}
    &lt;dd&gt;{{ field(**kwargs)|safe }}
    {% if field.errors %}
      &lt;ul class=errors&gt;
      {% for error in field.errors %}
        &lt;li&gt;{{ error }}&lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;
    {% endif %}
    &lt;/dd&gt;
  {% endmacro %}
  </code></pre>
  
  <p>In the forms themselves the individual fields are placed using...</p>
  
  <pre><code>{{ render_field(form.year_built, class="input text")}}
  </code></pre>
  
  <p>What I cannot figure out is a way to use the description in the field object within the part of the macro that creates the HTML field <code>field(**kwargs)</code>. I know that I can pass keywords to the render_field function but I am dealing with forms with more than 100 fields and setting the description in the forms.py and then setting it again as a title keyword in the template.html seems like unnecessary repletion. I would really like to use the macro to display a description as a title if it's there or just display the field without a title if its not.</p>
  
  <p>Is there a way to add new entries to <code>kwargs</code> before the field() function runs?</p>