Merge branch 'release/v3.28'
This commit is contained in:
+5
-1
@@ -247,8 +247,12 @@ def createc2workoutdata_as_splits(w):
|
||||
except TypeError:
|
||||
newnotes = 'from '+w.workoutsource+' via rowsandall.com'
|
||||
|
||||
wtype = w.workouttype
|
||||
if wtype in ('other','coastal'):
|
||||
wtype = 'water'
|
||||
|
||||
data = {
|
||||
"type": w.workouttype,
|
||||
"type": wtype,
|
||||
"date": w.startdatetime.isoformat(),
|
||||
"distance": int(w.distance),
|
||||
"time": int(10*makeseconds(durationstr)),
|
||||
|
||||
+1
-1
@@ -816,7 +816,7 @@ def new_workout_from_df(r,df,
|
||||
|
||||
timestr = strftime("%Y%m%d-%H%M%S")
|
||||
|
||||
csvfilename ='media/Fusion_'+timestr+'.csv'
|
||||
csvfilename ='media/df_'+timestr+'.csv'
|
||||
|
||||
|
||||
df.rename(columns = columndict,inplace=True)
|
||||
|
||||
+2
-2
@@ -61,8 +61,8 @@ class DocumentsForm(forms.Form):
|
||||
file = forms.FileField(required=True,
|
||||
validators=[validate_file_extension])
|
||||
workouttype = forms.ChoiceField(required=True,
|
||||
choices=Workout.workouttypes,
|
||||
initial='rower')
|
||||
choices=Workout.workouttypes)
|
||||
# initial='rower')
|
||||
notes = forms.CharField(required=False,
|
||||
widget=forms.Textarea)
|
||||
|
||||
|
||||
@@ -361,6 +361,7 @@ class Workout(models.Model):
|
||||
('slides','Indoor Rower on Slides'),
|
||||
('paddle','Paddle Adapter'),
|
||||
('snow','On-snow'),
|
||||
('coastal','Coastal'),
|
||||
('other','Other'),
|
||||
)
|
||||
|
||||
|
||||
+25
-2
@@ -146,7 +146,7 @@ USER_LANGUAGE = 'en-US'
|
||||
from interactiveplots import *
|
||||
|
||||
# Define the API documentation
|
||||
schema_view = get_swagger_view(title='Rowsandall API (Unstable)')
|
||||
schema_view = get_swagger_view(title='Rowsandall API')
|
||||
|
||||
# Custom error pages with Rowsandall headers
|
||||
def error500_view(request):
|
||||
@@ -6658,6 +6658,9 @@ def workout_upload_view(request,
|
||||
'make_plot':False,
|
||||
'upload_to_C2':False,
|
||||
'plottype':'timeplot',
|
||||
},
|
||||
docformoptions={
|
||||
'workouttype':'rower',
|
||||
}):
|
||||
|
||||
if 'uploadoptions' in request.session:
|
||||
@@ -6665,6 +6668,10 @@ def workout_upload_view(request,
|
||||
else:
|
||||
request.session['uploadoptions'] = uploadoptions
|
||||
|
||||
if 'docformoptions' in request.session:
|
||||
docformoptions = request.session['docformoptions']
|
||||
else:
|
||||
request.session['docformoptions'] = docformoptions
|
||||
|
||||
try:
|
||||
makeprivate = uploadoptions['makeprivate']
|
||||
@@ -6675,6 +6682,11 @@ def workout_upload_view(request,
|
||||
except KeyError:
|
||||
make_plot = False
|
||||
|
||||
try:
|
||||
workouttype = docformoptions['workouttype']
|
||||
except KeyError:
|
||||
workouttype = 'rower'
|
||||
|
||||
try:
|
||||
plottype = uploadoptions['plottype']
|
||||
except KeyError:
|
||||
@@ -6719,6 +6731,9 @@ def workout_upload_view(request,
|
||||
res = handle_uploaded_file(f)
|
||||
t = form.cleaned_data['title']
|
||||
workouttype = form.cleaned_data['workouttype']
|
||||
request.session['docformoptions'] = {
|
||||
'workouttype':workouttype,
|
||||
}
|
||||
|
||||
notes = form.cleaned_data['notes']
|
||||
|
||||
@@ -6930,7 +6945,7 @@ def workout_upload_view(request,
|
||||
|
||||
return response
|
||||
else:
|
||||
form = DocumentsForm()
|
||||
form = DocumentsForm(initial=docformoptions)
|
||||
optionsform = UploadOptionsForm(initial=uploadoptions)
|
||||
return render(request, 'document_form.html',
|
||||
{'form':form,
|
||||
@@ -7985,6 +8000,9 @@ def strokedatajson(request,id):
|
||||
# currently only returns a subset.
|
||||
columns = ['spm','time','hr','pace','power','distance']
|
||||
datadf = dataprep.getsmallrowdata_db(columns,ids=[id])
|
||||
with open('media/apilog.log','a') as logfile:
|
||||
logfile.write(str(timezone.now())+": ")
|
||||
logfile.write(request.user.username+"(GET) \n")
|
||||
return JSONResponse(datadf)
|
||||
|
||||
if request.method == 'POST':
|
||||
@@ -8033,6 +8051,10 @@ def strokedatajson(request,id):
|
||||
starttime = totimestamp(row.startdatetime)+time
|
||||
unixtime = starttime+time
|
||||
|
||||
with open('media/apilog.log','a') as logfile:
|
||||
logfile.write(starttime+": ")
|
||||
logfile.write(request.user.username+"(POST) \r\n")
|
||||
|
||||
data = pd.DataFrame({'TimeStamp (sec)':unixtime,
|
||||
' Horizontal (meters)': distance,
|
||||
' Cadence (stokes/min)':spm,
|
||||
@@ -8049,6 +8071,7 @@ def strokedatajson(request,id):
|
||||
' ElapsedTime (sec)':time,
|
||||
})
|
||||
|
||||
# Following part should be replaced with dataprep.new_workout_from_df
|
||||
|
||||
timestr = row.startdatetime.strftime("%Y%m%d-%H%M%S")
|
||||
csvfilename ='media/Import_'+timestr+'.csv'
|
||||
|
||||
Binary file not shown.
@@ -15,7 +15,7 @@
|
||||
}
|
||||
|
||||
.two {
|
||||
background-image: url("/static/img/landing2.jpg");
|
||||
background-image: url("/static/img/landing1.jpg");
|
||||
}
|
||||
|
||||
.three {
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
.four {
|
||||
background-image: url("/static/img/landing1.jpg");
|
||||
background-image: url("/static/img/landing8b.jpg");
|
||||
}
|
||||
|
||||
html {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Reference in New Issue
Block a user