-
Notifications
You must be signed in to change notification settings - Fork 5
/
forms.py
49 lines (39 loc) · 1.87 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField, SelectField, BooleanField
from wtforms.validators import DataRequired, Length, EqualTo
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Login')
class RegisterForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(min=5, max=15)])
password = PasswordField('Password', validators=[DataRequired(), Length(min=5, max=12)])
password_confirm = PasswordField('Confirm Password', validators=[DataRequired(),
EqualTo('password',
message='Passwords must be the same.')])
submit = SubmitField('Register')
class CreateWorkoutForm(FlaskForm):
location_name = SelectField('Location')
focus_name = SelectField('Focus')
part_a = StringField('Part A')
part_b = StringField('Part B')
part_c = StringField('Part C')
accessory = StringField('Accessory')
additional_info = StringField('Additional Info')
coach_notes = StringField('Coach Notes')
public_workout = BooleanField('Public')
submit = SubmitField('Create')
class EditWorkoutForm(FlaskForm):
location_name = SelectField('Location')
focus_name = SelectField('Focus')
part_a = StringField('Part A')
part_b = StringField('Part B')
part_c = StringField('Part C')
accessory = StringField('Accessory')
additional_info = StringField('Additional Info')
coach_notes = StringField('Coach Notes')
public_workout = BooleanField('Public')
submit = SubmitField('Update')
class DeleteForm(FlaskForm):
username = StringField('username')
submit = SubmitField('Delete')