-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
28 lines (24 loc) · 1.16 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, RadioField, TextAreaField
from wtforms.validators import DataRequired, InputRequired, Email
from wtforms.fields.html5 import EmailField
class SongForm(FlaskForm):
song = StringField('Song', validators=[DataRequired()],
default='Shape Of You')
artist = StringField('Artist', validators=[DataRequired()],
default='Ed Sheeran')
choice = RadioField('Has the artist had a billboard hit before this?',
validators=[InputRequired()],
choices=[
('Yes', 'Yes'),
('No', 'No'),
('Maybe', 'Maybe?')],
default='Yes'
)
submit = SubmitField('Predict!')
class FeedbackForm(FlaskForm):
name = StringField('Name', validators=[DataRequired()])
message = TextAreaField('Message', validators=[
DataRequired()], render_kw={'rows': 3, 'cols': 30})
email = EmailField('Email', validators=[DataRequired(), Email()])
submit = SubmitField('SEND')