-
Notifications
You must be signed in to change notification settings - Fork 3
/
data.py
20 lines (17 loc) · 910 Bytes
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.widgets import TextArea
from wtforms.validators import DataRequired, Length
class SearchBar(FlaskForm):
course_name = StringField('Enter a course, e.g. ECON 102 ', validators=[DataRequired(), Length(min=5)],
id="searchbar")
submit = SubmitField('Search')
class CourseData(FlaskForm):
review = StringField(widget=TextArea(), validators=[DataRequired(), Length(min=100)])
hours = SelectField(
'Number of hours',
choices=[('0', 'Hours spend outside of class?'),
('Below 3 hours', 'Below 3 hours'), ('3 to 6 hours', '3 to 6 hours'), ('7 to 10 hours', '7 to 10 hours'), ('11 to 14 hours', '11 to 14 hours'),
('15 to 18 hours', '15 to 18 hours'), ("I didn't have a life", "I didn't have a life")], validators=[DataRequired()]
)
submit = SubmitField('Submit')