Created
October 8, 2011 17:30
-
-
Save sheki/1272591 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from flaskext import wtf | |
| from flaskext.wtf import validators | |
| class PostForm(wtf.Form): | |
| self.languages = ['Java','Python','C','C++','Perl','HTML'] | |
| langTuples = [ (str(i) ,self.languages[i])for i in range(0,len(self.languages)) ] | |
| name = wtf.TextField('name', validators=[validators.Required()],) | |
| code = wtf.TextAreaField('code', validators=[validators.Required()]) | |
| lang = wtf.SelectField('language',choices=langTuples) | |
| def getLangByNo(self, no): | |
| return self.languages[int(no)] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment