meaning of `button_map` in the form_field definition in flask-bootstrap
<p>I am reading the documentation of <a href="https://pythonhosted.org/Flask-Bootstrap/forms.html" rel="nofollow">flask-boostrap doc</a>. In the <code>form_field</code> definition, what is the purpose of the <code>button_map</code>? </p>

<pre><code>form_field(field, form_type="basic", horizontal_columns=('lg', 2, 10), button_map={})
</code></pre>

<p>According to your link (see <a href="https://pythonhosted.org/Flask-Bootstrap/forms.html#quick_form" rel="nofollow"><code>quick_form</code></a>):</p>

<blockquote>
  <p><strong>button_map</strong> â A dictionary, mapping button field names to names such as <code>primary</code>, <code>danger</code> or <code>success</code>. Buttons not found in the <code>button_map</code> will use the <code>default</code> type of button.</p>
</blockquote>

<p>That means if you did something like</p>

<pre><code>form_field(submit_button, button_map={'submit_button': 'primary'})
</code></pre>

<p>you'd get a button with <code>primary</code> as its type.</p>

<p>As the docs also mention, <code>form_field</code> is used primarily by <code>quick_form</code> where a mapping makes more sense than for an individual field.</p>

python flask flask-wtforms flask-bootstrap