ff
This commit is contained in:
@@ -2422,7 +2422,15 @@ class PlannedSession(models.Model):
|
|||||||
|
|
||||||
steps = self.steps
|
steps = self.steps
|
||||||
|
|
||||||
|
try:
|
||||||
steps['filename'] = settings.MEDIA_ROOT+'/'+filename
|
steps['filename'] = settings.MEDIA_ROOT+'/'+filename
|
||||||
|
except TypeError:
|
||||||
|
try:
|
||||||
|
steps['filename'] = filename.name
|
||||||
|
except TypeError:
|
||||||
|
steps = json.loads(steps)
|
||||||
|
steps['filename'] = filename.name
|
||||||
|
self.steps = steps
|
||||||
fitfile = steps_write_fit(steps)
|
fitfile = steps_write_fit(steps)
|
||||||
|
|
||||||
filelist = fitfile.split('/media/')
|
filelist = fitfile.split('/media/')
|
||||||
|
|||||||
@@ -216,22 +216,21 @@
|
|||||||
<td>GET, POST, DELETE</td>
|
<td>GET, POST, DELETE</td>
|
||||||
<td>
|
<td>
|
||||||
<pre>{
|
<pre>{
|
||||||
"id": 17,
|
"id": 103,
|
||||||
"name": "Test Session",
|
"name": "ExampleSession",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"startdate": "2021-01-25",
|
"startdate": "2021-03-01",
|
||||||
"enddate": "2021-01-31",
|
"enddate": "2021-03-06",
|
||||||
"preferreddate": "2021-01-29",
|
"preferreddate": "2021-03-01",
|
||||||
"sessiontype": "session",
|
"sessiontype": "session",
|
||||||
"sessionvalue": 60,
|
"sessionvalue": 74,
|
||||||
"sessionunit": "min",
|
"sessionunit": "min",
|
||||||
"sessionmode": "time",
|
"sessionmode": "time",
|
||||||
"manager": 1,
|
|
||||||
"course": null,
|
"course": null,
|
||||||
"approximate_distance": 10000,
|
"approximate_distance": 16440,
|
||||||
"approximate_duration": 60,
|
"approximate_duration": 74,
|
||||||
"steps_json": "{\"filename\": \"/home/sander/python/rowsandall/media/8663f42528-20210213-133008-2021-02-16_4x500m2min_gMmFiFR.fit\", \"name\": \"4x500m/2min\", \"steps\": [{\"wkt_step_name\": \"Warm up\", \"duration_distance\": 2000.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 183, \"custom_target_heart_rate_high\": 188, \"intensity\": \"warmup\", \"message_index\": 0, \"duration_type\": \"distance\"}, {\"wkt_step_name\": \"Active\", \"duration_distance\": 500.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 239, \"custom_target_heart_rate_high\": 246, \"intensity\": \"active\", \"message_index\": 1, \"duration_type\": \"distance\"}, {\"wkt_step_name\": \"Recovery\", \"duration_time\": 120.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 202, \"custom_target_heart_rate_high\": 207, \"intensity\": \"rest\", \"message_index\": 2, \"duration_type\": \"time\"}, {\"wkt_step_name\": \"Active\", \"duration_distance\": 500.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 239, \"custom_target_heart_rate_high\": 246, \"intensity\": \"active\", \"message_index\": 3, \"duration_type\": \"distance\"}, {\"wkt_step_name\": \"Recovery\", \"duration_time\": 120.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 202, \"custom_target_heart_rate_high\": 207, \"intensity\": \"rest\", \"message_index\": 4, \"duration_type\": \"time\"}, {\"wkt_step_name\": \"Active\", \"duration_distance\": 500.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 239, \"custom_target_heart_rate_high\": 246, \"intensity\": \"active\", \"message_index\": 5, \"duration_type\": \"distance\"}, {\"wkt_step_name\": \"Recovery\", \"duration_time\": 120.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 202, \"custom_target_heart_rate_high\": 207, \"intensity\": \"rest\", \"message_index\": 6, \"duration_type\": \"time\"}, {\"wkt_step_name\": \"Active\", \"duration_distance\": 500.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 239, \"custom_target_heart_rate_high\": 246, \"intensity\": \"active\", \"message_index\": 7, \"duration_type\": \"distance\"}, {\"wkt_step_name\": \"Recovery\", \"duration_time\": 120.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 202, \"custom_target_heart_rate_high\": 207, \"intensity\": \"rest\", \"message_index\": 8, \"duration_type\": \"time\"}, {\"wkt_step_name\": \"Cool Down\", \"duration_distance\": 2000.0, \"target_type\": \"heart_rate\", \"target_hr_zone\": 0, \"custom_target_heart_rate_low\": 183, \"custom_target_heart_rate_high\": 188, \"intensity\": \"cooldown\", \"message_index\": 9, \"duration_type\": \"distance\"}, {\"wkt_step_name\": null, \"duration_value\": null, \"target_type\": null, \"target_value\": null, \"custom_target_value_low\": null, \"custom_target_value_high\": null, \"intensity\": \"cooldown\", \"message_index\": 10, \"duration_type\": \"open\"}], \"sport\": \"rowing\"}",
|
"steps": "{'filename': 'media/a7a7a621ad-20210302-074033-tmp2zcd7i_0.fit', 'workoutName': '', 'steps': [{'stepId': 0, 'wkt_step_name': '0', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}, {'stepId': 1, 'wkt_step_name': '1', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Active', 'description': ''}, {'stepId': 2, 'wkt_step_name': '2', 'durationType': 'Time', 'durationValue': 300000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}, {'stepId': 3, 'wkt_step_name': '3', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Active', 'description': ''}, {'stepId': 4, 'wkt_step_name': '4', 'durationType': 'Time', 'durationValue': 300000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}, {'stepId': 5, 'wkt_step_name': '5', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Active', 'description': ''}, {'stepId': 6, 'wkt_step_name': '6', 'durationType': 'Time', 'durationValue': 300000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}, {'stepId': 7, 'wkt_step_name': '7', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Active', 'description': ''}, {'stepId': 8, 'wkt_step_name': '8', 'durationType': 'Time', 'durationValue': 300000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}, {'stepId': 9, 'wkt_step_name': '9', 'durationType': 'Distance', 'durationValue': 200000, 'targetType': 'Speed', 'targetValue': 0, 'targetValueLow': 0, 'targetValueHigh': 0, 'intensity': 'Rest', 'description': ''}], 'sport': '', 'description': ''}",
|
||||||
"fitfile": "https://rowsandall.com/media/8663f42528-20210213-133008-2021-02-16_4x500m2min_gMmFiFR.fit"
|
"fitfile": "https://rowsandall.com/media/a7a7a621ad-20210302-074033-tmp2zcd7i_0.fit"
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user