Repository navigation
Add heart rate and duration fields to log model - #2128
elias170105 wants to merge 1 commit into
Conversation
Added fields for maximum and average heart rate, and duration, for the Cardiotrecking
|
@elias170105 thanks for this. One idea on Happy to help with tests or a draft if that direction works for you and the maintainers. Related: #2557 adds a |
|
@barkerd427 is right, it would be easier (and cleaner) to log the heart rate and then show those values in the workout overview. This would probably be interesting, regardless of whether this was a cardio exercise/workout. What we could do however, is add heart rate to the list of units, so that you could define an exercise has having a goal of "x minutes, y hear rate". I'm afraid I'll have to close the PR Edit: I've opened a new issue in #2563 |
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