adding description to step notes
This commit is contained in:
@@ -1053,7 +1053,7 @@ def get_workouts_session(r,ps):
|
|||||||
return ws
|
return ws
|
||||||
|
|
||||||
def create_sessions_from_json(plansteps,athletes,startdate,manager):
|
def create_sessions_from_json(plansteps,athletes,startdate,manager):
|
||||||
trainingdays = plansteps['plan']['trainingDays']
|
trainingdays = plansteps['trainingDays']
|
||||||
for day in trainingdays:
|
for day in trainingdays:
|
||||||
for workout in day['workouts']:
|
for workout in day['workouts']:
|
||||||
ps = PlannedSession(
|
ps = PlannedSession(
|
||||||
|
|||||||
@@ -977,12 +977,17 @@ def step_to_string(step):
|
|||||||
|
|
||||||
name = step['wkt_step_name']
|
name = step['wkt_step_name']
|
||||||
|
|
||||||
|
try:
|
||||||
|
notes = ' - '+step['description']
|
||||||
|
except KeyError:
|
||||||
|
notes = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
intensity = step['intensity']
|
intensity = step['intensity']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
intensity = 0
|
intensity = 0
|
||||||
|
|
||||||
s = '{name} {intensity} {duration} {unit} {target} {repeat}'.format(
|
s = '{name} {intensity} {duration} {unit} {target} {repeat} {notes}'.format(
|
||||||
nr = nr,
|
nr = nr,
|
||||||
name = name,
|
name = name,
|
||||||
unit=unit,
|
unit=unit,
|
||||||
@@ -990,6 +995,7 @@ def step_to_string(step):
|
|||||||
duration = duration,
|
duration = duration,
|
||||||
target=target,
|
target=target,
|
||||||
repeat = repeat,
|
repeat = repeat,
|
||||||
|
notes=notes,
|
||||||
)
|
)
|
||||||
|
|
||||||
if type == 'RepeatStep':
|
if type == 'RepeatStep':
|
||||||
|
|||||||
Reference in New Issue
Block a user