Merge branch 'develop' into feature/embeddedvideo
This commit is contained in:
@@ -347,9 +347,20 @@ def summaryfromsplitdata(splitdata,data,filename,sep='|'):
|
|||||||
timebased = False
|
timebased = False
|
||||||
|
|
||||||
for interval in splitdata:
|
for interval in splitdata:
|
||||||
idist = interval['distance']
|
try:
|
||||||
itime = interval['time']/10.
|
idist = interval['distance']
|
||||||
ipace = 500.*itime/idist
|
except KeyError:
|
||||||
|
idist = 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
itime = interval['time']/10.
|
||||||
|
except KeyError:
|
||||||
|
itime = 0
|
||||||
|
try:
|
||||||
|
ipace = 500.*itime/idist
|
||||||
|
except (ZeroDivisionError,OverflowError):
|
||||||
|
ipace = 180.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ispm = interval['stroke_rate']
|
ispm = interval['stroke_rate']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -3072,9 +3072,9 @@ attrs.update(strokedatafields)
|
|||||||
# when the StrokeData are expanded.
|
# when the StrokeData are expanded.
|
||||||
# No Django Instances of this model are managed. Strokedata table is
|
# No Django Instances of this model are managed. Strokedata table is
|
||||||
# accesssed directly with SQL commands
|
# accesssed directly with SQL commands
|
||||||
StrokeData = type(str('StrokeData'), (models.Model,),
|
#StrokeData = type(str('StrokeData'), (models.Model,),
|
||||||
attrs
|
# attrs
|
||||||
)
|
# )
|
||||||
|
|
||||||
# Storing data for the OTW CP chart
|
# Storing data for the OTW CP chart
|
||||||
class cpdata(models.Model):
|
class cpdata(models.Model):
|
||||||
|
|||||||
@@ -2906,7 +2906,12 @@ def workout_data_view(request, id=0):
|
|||||||
else:
|
else:
|
||||||
form = DataFrameColumnsForm(initial = {'cols':tcols})
|
form = DataFrameColumnsForm(initial = {'cols':tcols})
|
||||||
|
|
||||||
datadf = datadf[tcols]
|
try:
|
||||||
|
datadf = datadf[tcols]
|
||||||
|
except KeyError:
|
||||||
|
tcols = list(set(datadf.columns(tolist)+tcols))
|
||||||
|
datadf = datadf[tcols]
|
||||||
|
datadf = datadf.fillna(value=0)
|
||||||
|
|
||||||
for col in cols:
|
for col in cols:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user