Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible routines #1827

Open
wants to merge 150 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
6f54568
Start adding the models for the improved routines
rolandgeider Mar 4, 2024
6de7790
Add logic to calculate the dates and workout days from the given loop
rolandgeider Mar 6, 2024
9a321b7
Add simple weight calculations
rolandgeider Mar 7, 2024
50c3498
Correctly skip calculations if the user didn't log the needed weights
rolandgeider Mar 9, 2024
8b1e660
Handle the need_log_to_apply flag
rolandgeider Mar 10, 2024
2d36272
add escape hatch in form of custom logic used to calculate the sets
rolandgeider Mar 12, 2024
2830eea
Consolidate migrations
rolandgeider Mar 12, 2024
c3936b2
Merge branch 'master' into feature/flexible-routines
rolandgeider Mar 21, 2024
93138f8
Start exposing the routine data over the API
rolandgeider Mar 21, 2024
5511e1a
Expose the calculate date sequence over the API
rolandgeider Mar 21, 2024
750ace6
Expose the calculated weight config for each workout day
rolandgeider Mar 30, 2024
fec9380
Finally remove the canonical representation logic for the old workouts
rolandgeider Mar 30, 2024
2593be6
Simplify some of the dataclasses
rolandgeider Apr 7, 2024
f57c27d
Add first draft for migrating workouts to routines
rolandgeider Apr 17, 2024
9720d01
Add configuration to calculate the number of sets as well as the roun…
rolandgeider Apr 18, 2024
2a00af6
Rename SetNg to Slot
rolandgeider Apr 18, 2024
6b078f2
Move rounding to SlotConfig, as it makes more sense here
rolandgeider Apr 19, 2024
cea3b11
Move the "is_dropset" flag to the slot config, which is where it belongs
rolandgeider Apr 21, 2024
23aeb3e
Properly handle Null configuration options
rolandgeider Apr 24, 2024
1506f8b
Handle last_day_in_week flag
rolandgeider Apr 25, 2024
1c00d8e
Move the API documentation to the docs repo
rolandgeider Apr 25, 2024
13bbffa
Expose the full routine structure over the API
rolandgeider Apr 25, 2024
e167118
Merge branch 'refs/heads/master' into feature/flexible-routines
rolandgeider May 23, 2024
cafd89d
Merge branch 'refs/heads/master' into feature/flexible-routines
rolandgeider May 31, 2024
b1471cf
Add label model
rolandgeider May 31, 2024
a98ed5b
Expose a different view than the pure data structure
rolandgeider Jun 7, 2024
b445b8b
Don't use a boolean flag for dropsets
rolandgeider Jun 12, 2024
3444430
Add foreign key to next log entry
rolandgeider Jun 12, 2024
8b5bb07
Fix code "exercise_base" -> "exercise"
rolandgeider Jun 12, 2024
ba5cc26
Automatically create a session for logs
rolandgeider Jun 12, 2024
31277e4
Remove unneeded helper method
rolandgeider Jun 12, 2024
034b90c
The next_log foreign key is editable
rolandgeider Jun 12, 2024
f958a95
Add some ownership checks to the log
rolandgeider Jun 12, 2024
037fa29
Add a type to the day model as well
rolandgeider Jun 13, 2024
cddbeb5
Output the set configuration as a human readable string
rolandgeider Jun 13, 2024
b83434e
Small fixes, also expose slot comment
rolandgeider Jun 13, 2024
bea884c
Add the possibility to configure ranges for weight, reps and rest time
rolandgeider Jun 19, 2024
03c8dc3
Don't use an em dash to separate the sets
rolandgeider Jun 19, 2024
d78d9d0
Improve workout day output
rolandgeider Jun 19, 2024
d8eba56
Add some tests for the gym and display modes
rolandgeider Jun 20, 2024
9d804f4
Add RiR to RPE conversion
rolandgeider Jun 20, 2024
039346f
Consistently name functions
rolandgeider Jun 20, 2024
c4c6563
Remove trigger field
rolandgeider Jun 20, 2024
728364d
Start removing the old workout models
rolandgeider Jun 20, 2024
d67c206
Remove more old workout models
rolandgeider Jun 21, 2024
0e19fdf
Fix migration
rolandgeider Jun 21, 2024
1454d4a
Remove unused views
rolandgeider Jun 21, 2024
0b1f82d
Finally rename DayNg to just Day
rolandgeider Jun 21, 2024
7795c6e
Add endpoint that returns the day data for a complete iteration
rolandgeider Jun 21, 2024
1cd27e0
Small improvements to the text representation of the slot
rolandgeider Jun 25, 2024
a8e94a5
Expose the logs for the routine
rolandgeider Jun 26, 2024
4005375
Expose remaining clot config objects over the API
rolandgeider Jun 27, 2024
1af701b
Allow need_log_to_apply to be nullable as well
rolandgeider Jul 4, 2024
49f2caf
Use the date and user information from the session
rolandgeider Jul 7, 2024
a0c5d30
Merge branch 'refs/heads/master' into feature/flexible-routines
rolandgeider Jul 8, 2024
385df1d
Rename exercise model to translation
rolandgeider Jul 8, 2024
e7d4ffc
Rename exercisebase model to exercise
rolandgeider Jul 8, 2024
3a62e16
Re-add local import
rolandgeider Jul 8, 2024
b1bfb77
Further renaming base to exercise
rolandgeider Jul 9, 2024
b465ff4
Update key in API
rolandgeider Jul 10, 2024
393459e
Make all need_log_to_apply fields nullable
rolandgeider Jul 10, 2024
de53bda
Bump version
rolandgeider Jul 10, 2024
670ceb4
Use correct serializer for the Day endpoint
rolandgeider Jul 20, 2024
b280b41
Don't set the user when creating day objects
rolandgeider Jul 20, 2024
8d7e3f5
Expose slots and slot configs over the API
rolandgeider Jul 20, 2024
3f74825
Expose the routine over the day endpoint
rolandgeider Jul 20, 2024
88cb2ba
Fix linting in Dockerfile
rolandgeider Sep 30, 2024
fb243d4
Merge branch 'master' into feature/flexible-routines
rolandgeider Oct 5, 2024
de7655c
Set the iteration for calculated rest days as well
rolandgeider Oct 6, 2024
276d4eb
Merge branch 'master' into feature/flexible-routines
rolandgeider Oct 9, 2024
99af895
Fix typo
rolandgeider Oct 19, 2024
88589f6
Remove the 'replace' flag
rolandgeider Oct 20, 2024
49bbd18
Remove "next_day" foreign key
rolandgeider Oct 22, 2024
8dbc009
Remove trailing comma from the text representation
rolandgeider Oct 23, 2024
f33b18e
Allow the description to be left blank in days
rolandgeider Oct 25, 2024
3f3d9ae
Update migrations
rolandgeider Oct 27, 2024
b2b56f0
Move toggle to fit to week to routine object
rolandgeider Oct 28, 2024
f7d22e2
Start adding caching to routine calculations
rolandgeider Oct 28, 2024
059660b
Rename SlotConfig to SlotEntry, this makes more sense
rolandgeider Oct 28, 2024
bad75f9
Update test fixtures
rolandgeider Oct 28, 2024
30c1431
Add JSON field for additional configuration
rolandgeider Oct 29, 2024
f8a89e8
Add missing fields to serializers
rolandgeider Oct 30, 2024
9e69907
Always set repetition and weight units
rolandgeider Oct 30, 2024
4b8913e
Correctly calculate sets for one exercise
rolandgeider Nov 7, 2024
8998ca8
Some renaming
rolandgeider Nov 7, 2024
17c21ff
Some config values are always positive integers
rolandgeider Nov 7, 2024
37bf698
Merge branch 'master' into feature/flexible-routines
rolandgeider Nov 14, 2024
5c73bb1
Merge branch 'master' into feature/flexible-routines
rolandgeider Nov 14, 2024
1e30666
Allow empty day names
rolandgeider Nov 17, 2024
4d8255a
Calculate statistics for the routine
rolandgeider Nov 17, 2024
4696bf2
Update react files
rolandgeider Nov 17, 2024
e08b0c7
Remove link to schedules
rolandgeider Nov 19, 2024
d251906
Show rest time in text representation
rolandgeider Nov 20, 2024
677974e
Rename muscle_group to muscle
rolandgeider Nov 21, 2024
87a585d
Remove some unused views
rolandgeider Nov 21, 2024
2535824
Merge branch 'master' into feature/flexible-routines
rolandgeider Nov 21, 2024
8a7c081
Rename some urls, etc
rolandgeider Nov 21, 2024
fd1ffd5
Update react files
rolandgeider Nov 21, 2024
a00a79e
Move copy view to routine file
rolandgeider Nov 21, 2024
70be923
First round of fixing the PDF export views
rolandgeider Nov 21, 2024
9138f85
Bump version
rolandgeider Nov 21, 2024
f2f5406
Remove unused parameters for exercise PDF
rolandgeider Nov 22, 2024
e4fd899
Check that both the entry and the max variant are set
rolandgeider Nov 22, 2024
dc34bd2
Expose the day in the session serializer
rolandgeider Nov 25, 2024
ee1cf3d
Add react view for new log and session form
rolandgeider Nov 25, 2024
84e41d3
Add fields to configure the maximum number of sets as well
rolandgeider Nov 25, 2024
2e2247f
Add "repeat" parameter to the abstract config objects
rolandgeider Nov 25, 2024
47519f9
Don't allow "need_log_to_apply" to be nullable
rolandgeider Nov 25, 2024
b952fb5
Allow rounding values to be nullable
rolandgeider Nov 25, 2024
140137b
Handle base being zero
rolandgeider Nov 28, 2024
1d14386
Remove unused code and tests
rolandgeider Nov 28, 2024
f1a9670
Allow setting max rir values
rolandgeider Nov 29, 2024
2cb3b97
Remove more unused code
rolandgeider Nov 29, 2024
41a445d
Add 'not applicable' option
rolandgeider Nov 29, 2024
67b6396
Add requirements field for progression rules
rolandgeider Nov 29, 2024
f1b3661
Merge branch 'master' into feature/flexible-routines
rolandgeider Dec 6, 2024
7941e73
Handle filtering on the json field
rolandgeider Dec 6, 2024
5853544
Add target values for log values
rolandgeider Dec 12, 2024
b5e4c85
Fix migration script for workout logs and sessions
rolandgeider Dec 12, 2024
122afcf
Remove schedule models and logic
rolandgeider Dec 13, 2024
c5cffbd
Fix ican generation and tests
rolandgeider Dec 13, 2024
f13d4ee
Remove unused functions
rolandgeider Dec 13, 2024
da989c4
Rename url
rolandgeider Dec 13, 2024
d7924a4
Don't set a content disposition header
rolandgeider Dec 13, 2024
5073a74
Always call get_or_create
rolandgeider Dec 13, 2024
741064b
Fix some tests
rolandgeider Dec 13, 2024
1db132d
Fix email reminders command and tests
rolandgeider Dec 13, 2024
af834cf
Remove unused imports and other fixes
rolandgeider Dec 14, 2024
5901308
Merge branch 'master' into feature/flexible-routines
rolandgeider Dec 14, 2024
d0b9a99
Add filterset to allow more fine grained filter options for logs
rolandgeider Dec 14, 2024
03bb3ea
Put logs and statistics under the routine URL
rolandgeider Dec 17, 2024
4bd13a9
Add default rounding values to the user profile
rolandgeider Dec 20, 2024
18c8f62
Check if the user has an email set
rolandgeider Dec 20, 2024
a30e4fe
Allo the requirements field in the serializer to be nullable
rolandgeider Dec 21, 2024
e1b8b53
Add edit url for routines
rolandgeider Dec 21, 2024
6de967a
Calculate the intensity for the statistics
rolandgeider Dec 25, 2024
b0da8f6
Use correct url for editing
rolandgeider Dec 25, 2024
abaf6ea
Add edit progression url
rolandgeider Jan 4, 2025
065d432
Remove slots from rest days and add tests
rolandgeider Jan 4, 2025
2387f33
Add permissions and endpoints to manage routine templates
rolandgeider Jan 4, 2025
3c8e8bd
Cleanup unused workout templates, logic and urls
rolandgeider Jan 4, 2025
c5930a8
Remove old workout model and associated views
rolandgeider Jan 4, 2025
78ae0fa
Fix tests
rolandgeider Jan 4, 2025
9134649
Expose the max RiR over the API
rolandgeider Jan 8, 2025
34599c7
Set default value for max_rir
rolandgeider Jan 10, 2025
eaabf1e
Put the check for fit_in_week first
rolandgeider Jan 10, 2025
f5837d4
Merge branch 'master' into feature/flexible-routines
rolandgeider Jan 10, 2025
cfdade9
Don't use the hard coded default cache in the tests
rolandgeider Jan 11, 2025
23e026c
Add session object to every log, fix tests
rolandgeider Jan 11, 2025
3d98589
Re-add hard coded locmem test
rolandgeider Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ venv-wger
/coverage.lcov
/media/
/static/
/db/
/extras/docker/open-food-facts/dump/*.tar.gz
/extras/docker/open-food-facts/dump/off/*

Expand Down
4 changes: 2 additions & 2 deletions extras/scripts/filter-fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def filter_dump(model_list, filename):
filter_dump(('exercises.exerciseimage',), 'exercise-images.json')
filter_dump(
(
'exercises.exercisebase',
'exercises.exercise',
'exercises.variation',
),
'exercise-base-data.json',
)
filter_dump(
('exercises.exercise', 'exercises.exercisecomment', 'exercises.alias'), 'translations.json'
('exercises.translation', 'exercises.exercisecomment', 'exercises.alias'), 'translations.json'
)
filter_dump(
(
Expand Down
Empty file modified manage.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "wger"
version = "2.3.0a2"
version = "2.3.0a3"
dynamic = ["dependencies"]
authors = [
{ name = "Roland Geider", email = "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion wger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

MIN_APP_VERSION = (1, 7, 4, 'final', 1)

VERSION = (2, 3, 0, 'alpha', 3)
VERSION = (2, 3, 0, 'alpha', 4)
RELEASE = True


Expand Down
2 changes: 2 additions & 0 deletions wger/core/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class Meta:
'is_trustworthy',
'date_joined',
'gym',
'weight_rounding',
'reps_rounding',
'is_temporary',
'show_comments',
'show_english_ingredients',
Expand Down
3 changes: 1 addition & 2 deletions wger/core/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
MIN_APP_VERSION,
get_version,
)
from wger.core.api.permissions import AllowRegisterUser
from wger.core.api.serializers import (
DaysOfWeekSerializer,
LanguageSerializer,
Expand Down Expand Up @@ -130,7 +129,7 @@ def create(self, request, *args, **kwargs):
serializer.save()

# New email, update the user and reset the email verification flag
if request.user.email != data['email']:
if data.get('email') and request.user.email != data['email']:
request.user.email = data['email']
request.user.save()
request.user.userprofile.email_verified = False
Expand Down
Loading
Loading