wtforms/wtforms — pull request #81 by playpianolikewoah (2014-05-06 01:37:22+00:00)
Title: Adding custom attributes for option tags within SelectField and SelectMultipleField

Currently you do not allow the user to create html attributes on `
` tags within `SelectField` and `SelectMultipleField`. For example if a user wanted `
` it is not possible to create that with your current `Select` classes. This is something that I personally have needed and others have requested.

To use this new feature, for example:

groups_form.people.choices = [(p.id,p.full_name,{'data-role':p.role}) for p in group.people.all()]

If that third element is left out, everything stays the same.
The code above resulted in the following HTML for me:

Payton Small