Private
Public Access
1
0

some more fine tuning

This commit is contained in:
Sander Roosendaal
2022-04-07 19:00:01 +02:00
parent bd3da60c28
commit a6010815c8
4 changed files with 128 additions and 22 deletions

View File

@@ -2401,7 +2401,8 @@ class PlannedSessionStep(models.Model):
durationtypes = (
("Distance", "Distance"),
("Time", "Time")
("Time", "Time"),
('RepeatUntilStepsCmplt','Repeat previous blocks n times')
)
targettypes = (
@@ -2414,16 +2415,20 @@ class PlannedSessionStep(models.Model):
manager = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
name = models.TextField(default='',max_length=200, blank=True, null=True)
type = models.TextField(default='',max_length=200, blank=True, null=True)
durationvalue = models.FloatField(default=0)
durationtype = models.TextField(default='',max_length=200, blank=True, null=True,
choices=durationtypes)
targetvalue = models.IntegerField(default=0)
durationvalue = models.FloatField(default=0, verbose_name="Duration Value")
durationtype = models.TextField(default='Time',max_length=200,
choices=durationtypes,
verbose_name='Duration Type')
targetvalue = models.IntegerField(default=0, verbose_name="Target Value")
targettype = models.TextField(default='',max_length=200, blank=True, null=True,
choices=targettypes)
targetvaluelow = models.IntegerField(default=0)
targetvaluehigh = models.IntegerField(default=0)
choices=targettypes, verbose_name="Target Type")
targetvaluelow = models.IntegerField(default=0,
verbose_name="Target Value Low")
targetvaluehigh = models.IntegerField(default=0,
verbose_name="Target Value High")
intensity = models.TextField(default='',max_length=200, blank=True, null=True,
choices=intensitytypes)
choices=intensitytypes,
verbose_name = "Intensity")
description = models.TextField(default='',max_length=200, blank=True, null=True)
color = models.TextField(default='#ddd',max_length=200)
@@ -2434,6 +2439,8 @@ class PlannedSessionStep(models.Model):
self.color = '#90ee90'
elif self.intensity == "Rest":
self.color = 'add8e6'
if self.durationtype == 'RepeatUntilStepsCmplt':
self.color = 'ffffa7'
self.durationvalue = int(self.durationvalue)