summaryrefslogtreecommitdiff
path: root/app/forms
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-24 19:27:41 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-24 19:27:41 -0500
commit0dd74e2b672053e3296bc814a36988ba8463854f (patch)
treeccd0c41d15324513f419fa2b157d65268b6b63b2 /app/forms
parent586285028845c8ed9a2e859f1266c233b8278311 (diff)
downloadStrengthy-0dd74e2b672053e3296bc814a36988ba8463854f.tar.xz
Strengthy-0dd74e2b672053e3296bc814a36988ba8463854f.zip
Workout records are now written to the database
Diffstat (limited to 'app/forms')
-rw-r--r--app/forms/workout.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/forms/workout.py b/app/forms/workout.py
index cf9f635..5537114 100644
--- a/app/forms/workout.py
+++ b/app/forms/workout.py
@@ -7,7 +7,7 @@ from wtforms import (
SelectField,
StringField,
)
-from wtforms.validators import DataRequired, Email
+from wtforms.validators import DataRequired, Email, Optional
# /workout/create
class ExerciseCreateForm(Form):
@@ -28,11 +28,12 @@ class WorkoutCreateForm(FlaskForm):
# /workout/record
class SetForm(Form):
- lbs = IntegerField("lbs")
- reps = IntegerField("reps")
+ lbs = IntegerField("lbs", [Optional()])
+ units = IntegerField("units", [Optional()])
class ExerciseRecordForm(Form):
+ id = HiddenField("id", [DataRequired()])
sets = FieldList(FormField(SetForm))