Add new fields to LogDisplaySerializer #2129
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
bpm_max(PositiveInteger),bpm_avg(PositiveInteger), andduration(DurationField) to theWorkoutLogmodel to allow tracking of cardio exercises.WorkoutLogSerializerinserializers.pyto expose these fields via the API.These fields are optional (
blank=True, null=True), so they won't enforce data entry for strength training logs.Note: I could not locate the
WorkoutLogFormdefinition (it seems missing fromwger/manager/forms.pyin the current file structure). Therefore, this PR currently only enables these fields in the Backend and API, but not yet in the classic Web UI.Related Issue(s)
(If you have an issue number, replace this line with: Closes #YOUR_ISSUE_NUMBER. If not, you can delete this section.)
Please check that the PR fulfills these requirements
ruff format && isort .)Other questions
(e.g. database migration, deployment changes)?
Yes, database migrations are required:
python manage.py migrate