Skip to content

Rework measurements - #2476

Open
rolandgeider wants to merge 60 commits into
masterfrom
feature/health-sync
Open

Rework measurements#2476
rolandgeider wants to merge 60 commits into
masterfrom
feature/health-sync

Conversation

@rolandgeider

Copy link
Copy Markdown
Member

This PR reworks the measurements model, making them more flexible and allowing us to sync health data to them

Closes #2417

rolandgeider and others added 30 commits June 25, 2026 20:07
This can happen if e.g. the user deleted their user and is still logged in
on the app
…h-sync)(wger#2328)

Changes:
* Schema: Added 'is_official' flag and UniqueConstraint to measurements.Category.
* Migrations: Created schema migration (0007) and data backfill migration (0008).
* API (Serializer/Views): Re-pointed WeightEntry endpoint to read/write from Measurement models using the official 'body_weight' category.
* API (Filters): Updated WeightEntryFilterSet to map legacy 'weight' params to the new 'value' column.
* Legacy: Marked WeightEntry model as deprecated.
This is not needed, as externally synced entries can be found through other
fields, such as the external_id
Measurement categories can optionally point to another category, In practice, this
will just be something like blood pressure since these values only make sense in a
pair. Others can be interesting while combined (heart rate and steps), but are valid
on their own.
# Conflicts:
#	wger/utils/viewsets.py
Users can enter values in mixed units, external syncs will store their
provenance here as well
…ts-and-weight-2328

refactor(weight): migrate WeightEntry to Measurement (wger#2328)
This was forgotten in the previous commits
rolandgeider added a commit that referenced this pull request Aug 13, 2026
rolandgeider added a commit that referenced this pull request Aug 13, 2026
Same adaptation as for the session tests: the Django-test-client based
tests from PR #2476 predate 863dfea and posted multipart, which now
returns 415. The APIClient based tests already send JSON via
TEST_REQUEST_DEFAULT_FORMAT.
@rolandgeider rolandgeider mentioned this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Health-Data-Sync

2 participants