Created
November 3, 2011 13:03
-
-
Save jeanphix/1336422 to your computer and use it in GitHub Desktop.
WTForms CountrySelectField
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pycountry | |
class CountrySelectField(SelectField): | |
def __init__(self, *args, **kwargs): | |
super(CountrySelectField, self).__init__(*args, **kwargs) | |
self.choices = [(c.alpha3, c.name) for c in pycountry.countries] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment