Private
Public Access
1
0

modality and boat type selection working on multiflex

This commit is contained in:
Sander Roosendaal
2017-08-10 13:58:47 +02:00
parent 8156034ae1
commit c74b08d966
5 changed files with 132 additions and 18 deletions

View File

@@ -368,7 +368,7 @@ class Workout(models.Model):
workoutsource = models.CharField(choices=workoutsources,max_length=100,
default='unknown')
boattype = models.CharField(choices=boattypes,max_length=50,
default='1x (single)',
default='1x',
verbose_name = 'Boat Type')
starttime = models.TimeField(blank=True,null=True)
startdatetime = models.DateTimeField(blank=True,null=True)
@@ -405,17 +405,30 @@ class Workout(models.Model):
ownerfirst = self.user.user.first_name
ownerlast = self.user.user.last_name
duration = self.duration
boattype = self.boattype
workouttype = self.workouttype
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {ownerfirst} {ownerlast}'.format(
d = date.strftime('%Y-%m-%d'),
n = name,
dist = distance,
duration = duration,
workouttype = workouttype,
ownerfirst = ownerfirst,
ownerlast = ownerlast,
)
if workouttype != 'water':
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {ownerfirst} {ownerlast}'.format(
d = date.strftime('%Y-%m-%d'),
n = name,
dist = distance,
duration = duration,
workouttype = workouttype,
ownerfirst = ownerfirst,
ownerlast = ownerlast,
)
else:
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
d = date.strftime('%Y-%m-%d'),
n = name,
dist = distance,
duration = duration,
workouttype = workouttype,
boattype=boattype,
ownerfirst = ownerfirst,
ownerlast = ownerlast,
)
return stri