-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforms.py
55 lines (44 loc) · 1.51 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
50
51
52
53
54
55
from flask_wtf import FlaskForm
from wtforms import (
StringField,
PasswordField,
SelectField,
SelectMultipleField)
from wtforms.validators import DataRequired
class UserAddForm(FlaskForm):
"""Form for Creating an Account"""
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
class LoginForm(FlaskForm):
"""Login Form"""
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
class SearchExerciseForm(FlaskForm):
"""Form for filtering exercises"""
name = StringField('Filter by name:')
category = SelectField(
'Filter by category:',
choices=[
'<none>',
'Abs',
'Arms',
'Back',
'Calves',
'Chest',
'Legs',
'Shoulders'])
equipment = SelectMultipleField(
'Available Equipment (Use command/control to select multiple)',
choices=[
('1', 'Barbell'),
('8', 'Bench'),
('3', 'Dumbell'),
('9', 'Incline bench'),
('10', 'Kettlebell'),
('6', 'Pull-up bar'),
('5', 'Swiss Ball'),
('2', 'SZ-Bar')])
class AddWorkoutForm(FlaskForm):
"""Form for creating a new workout"""
type = SelectField('Type of Workout:', choices=['AMRAP', 'EMOM', 'RFT'])
name = StringField('Workout Name:', validators=[DataRequired()])