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