Self hosted FLOSS fitness/workout, nutrition and weight tracker
Add 'not applicable' option
Roland Geider41a445d8c3df
diff --git a/wger/manager/migrations/0018_flexible_routines.py b/wger/manager/migrations/0018_flexible_routines.pyindex 7c23fdc51..5ad4332fd 100644--- a/wger/manager/migrations/0018_flexible_routines.py+++ b/wger/manager/migrations/0018_flexible_routines.py@@ -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,@@ -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,@@ -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,@@ -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,@@ -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,@@ -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,@@ -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,@@ -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,@@ -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,),diff --git a/wger/manager/models/abstract_config.py b/wger/manager/models/abstract_config.pyindex b32b3e3a0..85f749a25 100644--- a/wger/manager/models/abstract_config.py+++ b/wger/manager/models/abstract_config.py@@ -25,6 +25,7 @@ class OperationChoices(models.TextChoices):class StepChoices(models.TextChoices):+ NOT_APPLICABLE = 'na'ABSOLUTE = 'abs'PERCENT = 'percent'@@ -105,7 +106,7 @@ class AbstractChangeConfig(models.Model):# Override values for replaceif self.replace:self.need_log_to_apply = False- self.step = 'abs'+ self.step = StepChoices.NOT_APPLICABLEsuper().save(**kwargs)