diff options
| author | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 19:30:26 -0600 |
|---|---|---|
| committer | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 19:30:26 -0600 |
| commit | fca2594b3ed87fcdc02be12523d43e113931a3ff (patch) | |
| tree | 3a06c0a478de266afff573730037787542065dfb /app/forms | |
| parent | 909829370f733bc6a6598c1d741970b7a6399a12 (diff) | |
| download | Strengthy-fca2594b3ed87fcdc02be12523d43e113931a3ff.tar.xz Strengthy-fca2594b3ed87fcdc02be12523d43e113931a3ff.zip | |
(#3) Add support for removing exercises
Diffstat (limited to 'app/forms')
| -rw-r--r-- | app/forms/workout.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/forms/workout.py b/app/forms/workout.py index 8714d5b..45d7f01 100644 --- a/app/forms/workout.py +++ b/app/forms/workout.py @@ -14,6 +14,18 @@ from wtforms import ( from wtforms.validators import DataRequired, Email, Optional # /workout/create + + +class ExerciseEditForm(Form): + id = HiddenField("id", [Optional()]) + name = StringField("name", [Optional()]) + sets = IntegerField("sets", [Optional()]) + units = FloatField("units", [Optional()]) + type = SelectField( + "type", [Optional()], choices=[("reps", "Reps"), ("time", "Time")] + ) + + class ExerciseCreateForm(Form): id = HiddenField("id", [Optional()]) name = StringField("name", [DataRequired()]) @@ -29,7 +41,13 @@ class WorkoutCreateForm(FlaskForm): exercises = FieldList(FormField(ExerciseCreateForm), min_entries=1) +class WorkoutEditForm(FlaskForm): + name = StringField("name", [DataRequired()]) + exercises = FieldList(FormField(ExerciseEditForm), min_entries=1) + # /workout/record + + class SetForm(Form): lbs = FloatField("lbs", [Optional()]) units = IntegerField("units", [Optional()]) |
