moving save routine to dataprepnodjango
This commit is contained in:
@@ -135,6 +135,15 @@ def rdata(file,rower=rrower()):
|
|||||||
|
|
||||||
from utils import totaltime_sec_to_string
|
from utils import totaltime_sec_to_string
|
||||||
|
|
||||||
|
def create_strava_stroke_data_db(workoutid,df,csvfilename,debug=False):
|
||||||
|
df.sort_values(by='TimeStamp (sec)',ascending=True)
|
||||||
|
|
||||||
|
res = df.to_csv(csvfilename+'.gz',index_label='index',compression='gzip')
|
||||||
|
|
||||||
|
|
||||||
|
data = dataprep(df,id=workoutid,bands=False,debug=debug)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
# Creates C2 stroke data
|
# Creates C2 stroke data
|
||||||
def create_c2_stroke_data_db(
|
def create_c2_stroke_data_db(
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ from rowers.dataprepnodjango import (
|
|||||||
update_agegroup_db,fitnessmetric_to_sql,
|
update_agegroup_db,fitnessmetric_to_sql,
|
||||||
add_c2_stroke_data_db,totaltime_sec_to_string,
|
add_c2_stroke_data_db,totaltime_sec_to_string,
|
||||||
create_c2_stroke_data_db,update_empower,
|
create_c2_stroke_data_db,update_empower,
|
||||||
database_url_debug,database_url,dataprep
|
database_url_debug,database_url,dataprep,
|
||||||
|
create_strava_stroke_data_db
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -201,15 +202,8 @@ def handle_strava_import_stroke_data(stravatoken,
|
|||||||
' Power (watts)':watts,
|
' Power (watts)':watts,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
res = create_strava_stroke_data_db(workoutid,df,csvfilename,debug=debug)
|
||||||
|
|
||||||
df.sort_values(by='TimeStamp (sec)',ascending=True)
|
|
||||||
|
|
||||||
res = df.to_csv(csvfilename+'.gz',index_label='index',compression='gzip')
|
|
||||||
|
|
||||||
|
|
||||||
# data = update_strokedata(workoutid,df,debug=debug)
|
|
||||||
data = dataprep(df,id=workoutid,bands=False,debug=debug)
|
|
||||||
# startdatetime = datetime.datetime.strptime(startdatetime,"%Y-%m-%d-%H:%M:%S")
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|||||||
@@ -10263,7 +10263,10 @@ def workout_getstravaworkout_next(request):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
url = reverse(workouts_view)
|
url = reverse(r.defaultlandingpage,
|
||||||
|
kwargs={
|
||||||
|
'id':workoutid,
|
||||||
|
})
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user