igdb/code/app/forms.py

48 lines
1.3 KiB
Python
Raw Normal View History

from flask_wtf import FlaskForm
2020-01-09 19:13:24 +01:00
from wtforms import BooleanField, PasswordField, SelectField, StringField, SubmitField
from wtforms.validators import DataRequired
class LoginForm(FlaskForm):
username = StringField("Username", validators=[DataRequired()])
password = PasswordField("Password", validators=[DataRequired()])
remember_me = BooleanField("Remember Me")
submit = SubmitField("Sign In")
2020-01-09 19:13:24 +01:00
class YearForm(FlaskForm):
year_list = [
("2011", 2011),
("2012", 2012),
("2013", 2013),
("2014", 2014),
("2015", 2015),
("2016", 2016),
("2017", 2017),
("2018", 2018),
]
name = StringField("Glacier Name")
2020-01-09 19:13:24 +01:00
year = SelectField("Year", validators=[DataRequired()], choices=year_list)
submit = SubmitField("Search")
class IntervalForm(FlaskForm):
year_list = [
("2011", 2011),
("2012", 2012),
("2013", 2013),
("2014", 2014),
("2015", 2015),
("2016", 2016),
("2017", 2017),
("2018", 2018),
]
name = StringField("Glacier Name")
lower_bound = SelectField(
"First year", validators=[DataRequired()], choices=year_list
)
upper_bound = SelectField(
"Second year", validators=[DataRequired()], choices=year_list
)
submit = SubmitField("Search")