From c93c3a51e5e62a30b4f92b5fd1e15197b7d4cb00 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sat, 13 Feb 2021 14:47:36 +0100 Subject: [PATCH] updated API instructions --- rowers/models.py | 5 ++++- rowers/templates/developers.html | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rowers/models.py b/rowers/models.py index 38711073..ce237c9e 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -2370,7 +2370,10 @@ class PlannedSession(models.Model): steps = steps_read_fit(settings.MEDIA_ROOT+'/'+self.fitfile.name) self.steps_json = json.dumps(steps) - super(PlannedSession,self).save(*args, **kwargs) + try: + super(PlannedSession,self).save(*args, **kwargs) + except: + pass diff --git a/rowers/templates/developers.html b/rowers/templates/developers.html index 9dbbf9e9..cb718b16 100644 --- a/rowers/templates/developers.html +++ b/rowers/templates/developers.html @@ -227,7 +227,11 @@ "sessionunit": "min", "sessionmode": "time", "manager": 1, - "course": null + "course": null, + "approximate_distance": 10000, + "approximate_duration": 60, + "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\"}", + "fitfile": "https://rowsandall.com/media/8663f42528-20210213-133008-2021-02-16_4x500m2min_gMmFiFR.fit" }