diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 6d4915a1..2e130d05 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -853,7 +853,7 @@ def getrowdata_db(id=0,doclean=False): def getsmallrowdata_db(columns,ids=[],doclean=True,workstrokesonly=True): prepmultipledata(ids) data = read_cols_df_sql(ids,columns) - + if 'peakforce' in columns: data['peakforce'] = data['peakforce']*lbstoN if 'averageforce' in columns: @@ -862,7 +862,7 @@ def getsmallrowdata_db(columns,ids=[],doclean=True,workstrokesonly=True): if doclean: data = clean_df_stats(data,ignorehr=True, workstrokesonly=workstrokesonly) - + return data # Fetch both the workout and the workout stroke data (from CSV file) @@ -921,7 +921,7 @@ def prepmultipledata(ids,verbose=False): def read_cols_df_sql(ids,columns): # drop columns that are not in offical list # axx = [ax[0] for ax in axes] - axx = StrokeData._meta.get_all_field_names() + axx = [f.name for f in StrokeData._meta.get_fields()] for c in columns: if not c in axx: columns.remove(c) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index f8bcb218..823ae3bf 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -889,12 +889,14 @@ def interactive_chart(id=0,promember=0): def interactive_cum_flex_chart2(theworkouts,promember=0, xparam='spm', yparam1='power', - yparam2='spm'): + yparam2='spm', + workstrokesonly=False): # datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2) ids = [int(w.id) for w in theworkouts] columns = [xparam,yparam1,yparam2,'spm','driveenergy','distance'] - datadf = dataprep.getsmallrowdata_db(columns,ids=ids,doclean=False) + datadf = dataprep.getsmallrowdata_db(columns,ids=ids,doclean=False, + workstrokesonly=workstrokesonly) try: tests = datadf[yparam2] @@ -1176,7 +1178,6 @@ def interactive_flex_chart2(id=0,promember=0, workstrokesonly=False): - #rowdata,row = dataprep.getrowdata_db(id=id) columns = [xparam,yparam1,yparam2, 'ftime','distance','fpace', diff --git a/rowers/templates/cum_flex.html b/rowers/templates/cum_flex.html index 7a43c0b9..50bed044 100644 --- a/rowers/templates/cum_flex.html +++ b/rowers/templates/cum_flex.html @@ -6,150 +6,153 @@ {% block content %} - {{ js_res | safe }} - {{ css_res| safe }} +{{ js_res | safe }} +{{ css_res| safe }} - - - + + + - {{ interactiveplot |safe }} +{{ interactiveplot |safe }} - +
Summary for {{ theuser.first_name }} {{ theuser.last_name }} - between {{ startdate|date }} and {{ enddate|date }}
- - - --
Warning: Large date ranges may take a long time to load. Huge date ranges may crash your browser.
-Use this form to select a different date range:
-- Select start and end date for a date range: -
Warning: Large date ranges may take a long time to load. Huge date ranges may crash your browser.
+ +Use this form to select a different date range:
++ Select start and end date for a date range: +
Summary for {{ theuser.first_name }} {{ theuser.last_name }} + between {{ startdate|date }} and {{ enddate|date }}
+ + + + + @@ -159,7 +162,7 @@