Private
Public Access
1
0

additional metrics are available in flex chart

This commit is contained in:
Sander Roosendaal
2017-11-29 13:26:29 +01:00
parent 4e5b661923
commit a80df03d60
4 changed files with 97 additions and 70 deletions

View File

@@ -916,6 +916,16 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
w.startdatetime = timezone.now()
w.save()
if privacy == 'visible':
ts = Team.objects.filter(rower=r)
for t in ts:
w.team.add(t)
# put stroke data in database
res = dataprep(row.df, id=w.id, bands=True,
barchart=True, otwpower=True, empower=True, inboard=inboard)
isbreakthrough = False
ishard = False
if workouttype == 'water':
@@ -981,14 +991,6 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
else:
pass
if privacy == 'visible':
ts = Team.objects.filter(rower=r)
for t in ts:
w.team.add(t)
# put stroke data in database
res = dataprep(row.df, id=w.id, bands=True,
barchart=True, otwpower=True, empower=True, inboard=inboard)
return (w.id, message)
@@ -1150,14 +1152,6 @@ def new_workout_from_file(r, f2,
a = MessageAttachment(message=msg,document=f3)
a.save()
# res = myqueue(
# queuelow,
# handle_zip_file,
# r.user.email,
# title,
# f2
# )
return -1, message, f2
# Some people try to upload Concept2 logbook summaries
@@ -1564,7 +1558,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True):
cdata2 = savgol_filter(cdata.values,windowsize,3)
print len(cdata),len(cdata2),'mies'
data[c] = cdata
data[c] = cdata2
except KeyError:
data[c] = 0
@@ -1642,12 +1636,14 @@ def read_cols_df_sql(ids, columns, convertnewtons=True):
axx = [f.name for f in StrokeData._meta.get_fields()]
extracols = []
for c in columns:
if not c in axx:
columns.remove(c)
extracols.append(c)
columns = list(columns) + ['distance', 'spm', 'workoutid']
columns = [x for x in columns if x != 'None']
columns = list(set(columns))