Skip to content

Commit

Permalink
Add 'not applicable' option
Browse files Browse the repository at this point in the history
This is basically a NULL option for the first iteration
  • Loading branch information
rolandgeider committed Nov 29, 2024
1 parent 2cb3b97 commit 41a445d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
54 changes: 45 additions & 9 deletions wger/manager/migrations/0018_flexible_routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -437,7 +441,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -490,7 +498,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -593,7 +605,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -640,7 +656,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -687,7 +707,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -734,7 +758,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -781,7 +809,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
null=False,
Expand Down Expand Up @@ -828,7 +860,11 @@ class Migration(migrations.Migration):
(
'step',
models.CharField(
choices=[('abs', 'Absolute'), ('percent', 'Percent')],
choices=[
('na', 'Not Applicable'),
('abs', 'Absolute'),
('percent', 'Percent'),
],
default='abs',
max_length=10,
),
Expand Down
3 changes: 2 additions & 1 deletion wger/manager/models/abstract_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class OperationChoices(models.TextChoices):


class StepChoices(models.TextChoices):
NOT_APPLICABLE = 'na'
ABSOLUTE = 'abs'
PERCENT = 'percent'

Expand Down Expand Up @@ -105,7 +106,7 @@ def save(self, **kwargs):
# Override values for replace
if self.replace:
self.need_log_to_apply = False
self.step = 'abs'
self.step = StepChoices.NOT_APPLICABLE

super().save(**kwargs)

Expand Down

0 comments on commit 41a445d

Please sign in to comment.