Skip to content

Feature/dynamic measurements#2338

Open
dylans-dev wants to merge 11 commits into
wger-project:masterfrom
jshudbrd:feature/dynamic-measurements
Open

Feature/dynamic measurements#2338
dylans-dev wants to merge 11 commits into
wger-project:masterfrom
jshudbrd:feature/dynamic-measurements

Conversation

@dylans-dev

@dylans-dev dylans-dev commented May 12, 2026

Copy link
Copy Markdown

Proposed Changes

  • Add support for dynamic measurement categories.
  • The /api/v2/measurement/ endpoint now intercepts requests for dynamic categories (such as BMI) and auto-calculates the results on the fly.
  • A new endpoint at /api/v2/measurement-category/dynamic-types/ has been added to expose the available dynamic options.
  • An enum is used for the new dynamic options with BMI currently and can be extended for more options and calculations.
  • Utils package added with bmi module for BMI calculation.

Related Issue(s)

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Code has been formatted to avoid unnecessary diffs (ruff format && isort .)
  • If the feature is big enough or if there are manual steps needed (deployment
    changes etc.), write a small writeup in CHANGELOG.md

Comment thread wger/measurements/models/category.py
Comment thread wger/measurements/utils/bmi.py Outdated
Comment thread wger/measurements/utils/bmi.py Outdated
Comment thread wger/measurements/api/views.py Outdated
@dylans-dev

dylans-dev commented May 15, 2026

Copy link
Copy Markdown
Author

Hey, I've made the requested changes regarding adding dynamic calc params, pagination and cleaned up migrations.
I also want to add a validator shortly with an example of what params should be included for instance with a 1 rep max calculation, since I'm running short on time to implement it in full

@dylans-dev dylans-dev requested a review from rolandgeider May 15, 2026 09:04
@dylans-dev

Copy link
Copy Markdown
Author

Hey, sorry I forgot to review my tests after I made those requested changes, the tests pass on my end now after that latest commit.

@rolandgeider

Copy link
Copy Markdown
Member

Hey, sorry I forgot to review my tests

don't worry, that's why we have 'em! 😄

@dylans-dev

Copy link
Copy Markdown
Author

Hey, sorry I forgot to review my tests

don't worry, that's why we have 'em! 😄

Haha it always happens to me, I'll work on fixing the front end now too.

@rolandgeider

rolandgeider commented May 22, 2026

Copy link
Copy Markdown
Member

FYI, since we're getting close to finishing a big release (see e.g. wger-project/flutter#1183), I'm moving this to the next version 2.7 since the dynamic measurements come with some changes to the backend and frontend and I'd be more comfortable with some time

@rolandgeider rolandgeider linked an issue Jun 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic measurements

2 participants