|
|
|
@@ -98,7 +98,8 @@ import rowers.uploads as uploads
|
|
|
|
|
from django.forms.formsets import formset_factory
|
|
|
|
|
from django.forms import modelformset_factory
|
|
|
|
|
import StringIO
|
|
|
|
|
from django.contrib.auth.decorators import login_required,user_passes_test
|
|
|
|
|
from django.contrib.auth.decorators import login_required #,user_passes_test
|
|
|
|
|
from rowers.decorators import user_passes_test
|
|
|
|
|
from time import strftime,strptime,mktime,time,daylight
|
|
|
|
|
import os,sys
|
|
|
|
|
import datetime
|
|
|
|
@@ -161,7 +162,7 @@ from scipy.signal import savgol_filter
|
|
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
|
from Cookie import SimpleCookie
|
|
|
|
|
from shutil import copyfile,move
|
|
|
|
|
import types
|
|
|
|
|
import mytypes
|
|
|
|
|
from rowingdata import rower as rrower
|
|
|
|
|
from rowingdata import main as rmain
|
|
|
|
|
from rowingdata import rowingdata as rrdata
|
|
|
|
@@ -630,7 +631,7 @@ def get_thumbnails(request,id):
|
|
|
|
|
aantalcomments = len(comments)
|
|
|
|
|
|
|
|
|
|
workouttype = 'ote'
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
workouttype = 'otw'
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
@@ -2475,7 +2476,7 @@ def cum_flex_data(
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'rankingonly':False,
|
|
|
|
|
'modality':'all',
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'theuser':0,
|
|
|
|
|
'xparam':'spm',
|
|
|
|
|
'yparam1':'power',
|
|
|
|
@@ -2504,7 +2505,7 @@ def cum_flex_data(
|
|
|
|
|
enddatestring = keyvalue_get_default('enddatestring',options,def_options)
|
|
|
|
|
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
@@ -2579,7 +2580,7 @@ def histo_data(
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'rankingonly':False,
|
|
|
|
|
'modality':'all',
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'theuser':0,
|
|
|
|
|
'enddatestring':'',
|
|
|
|
|
'startdatestring':'',
|
|
|
|
@@ -2602,7 +2603,7 @@ def histo_data(
|
|
|
|
|
enddatestring = keyvalue_get_default('enddatestring',options,def_options)
|
|
|
|
|
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
@@ -2679,8 +2680,8 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
enddatestring="",
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'workouttypes':[i[0] for i in types.workouttypes],
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'workouttypes':[i[0] for i in mytypes.workouttypes],
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'rankingonly':False,
|
|
|
|
|
}):
|
|
|
|
|
|
|
|
|
@@ -2691,7 +2692,7 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
if 'waterboattype' in request.session:
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in request.session:
|
|
|
|
@@ -2706,7 +2707,7 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2723,7 +2724,7 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
|
|
|
|
|
workstrokesonly = not includereststrokes
|
|
|
|
|
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if startdatestring != "":
|
|
|
|
@@ -2757,12 +2758,12 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
rankingonly = modalityform.cleaned_data['rankingonly']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.session['modalities'] = modalities
|
|
|
|
@@ -2799,7 +2800,7 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
flexaxesform = FlexAxesForm(request,initial=initial)
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -2861,7 +2862,13 @@ def cum_flex(request,theuser=0,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
def planrequired_view(request):
|
|
|
|
|
messages.info(request,"This functionality requires Coach or Self-Coach membership")
|
|
|
|
|
|
|
|
|
|
return render(request,'promembership.html')
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def fitnessmetric_view(request,id=0,mode='rower',
|
|
|
|
|
startdate=timezone.now()-timezone.timedelta(days=365),
|
|
|
|
@@ -2904,6 +2911,7 @@ def fitnessmetric_view(request,id=0,mode='rower',
|
|
|
|
|
|
|
|
|
|
# Show the EMpower Oarlock generated Stroke Profile
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_forcecurve_view(request,id=0,workstrokesonly=False):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
@@ -3034,7 +3042,9 @@ def workout_histo_view(request,id=0):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Histogram for a date/time range
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def histo(request,theuser=0,
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
|
|
|
|
enddate=timezone.now(),
|
|
|
|
@@ -3043,8 +3053,8 @@ def histo(request,theuser=0,
|
|
|
|
|
enddatestring="",
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'workouttypes':[i[0] for i in types.workouttypes],
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'workouttypes':[i[0] for i in mytypes.workouttypes],
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'rankingonly': False,
|
|
|
|
|
}):
|
|
|
|
|
|
|
|
|
@@ -3054,7 +3064,7 @@ def histo(request,theuser=0,
|
|
|
|
|
if 'waterboattype' in request.session:
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in request.session:
|
|
|
|
@@ -3069,7 +3079,7 @@ def histo(request,theuser=0,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3086,7 +3096,7 @@ def histo(request,theuser=0,
|
|
|
|
|
|
|
|
|
|
workstrokesonly = not includereststrokes
|
|
|
|
|
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if startdatestring != "":
|
|
|
|
@@ -3119,12 +3129,12 @@ def histo(request,theuser=0,
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
rankingonly = modalityform.cleaned_data['rankingonly']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.session['modalities'] = modalities
|
|
|
|
@@ -3151,7 +3161,7 @@ def histo(request,theuser=0,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -4090,7 +4100,9 @@ def rankings_view2(request,theuser=0,
|
|
|
|
|
'teams':get_my_teams(request.user),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_update_cp_view(request,id=0):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
|
|
|
|
|
@@ -4108,7 +4120,7 @@ def workout_update_cp_view(request,id=0):
|
|
|
|
|
|
|
|
|
|
dataprep.runcpupdate(r)
|
|
|
|
|
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
url = reverse(otwrankings_view)
|
|
|
|
|
else:
|
|
|
|
|
url = reverse(oterankings_view)
|
|
|
|
@@ -4116,7 +4128,9 @@ def workout_update_cp_view(request,id=0):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Show ranking distances including predicted paces
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def otwrankings_view(request,theuser=0,
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
|
|
|
|
enddate=timezone.now(),
|
|
|
|
@@ -4519,7 +4533,9 @@ def otwcp_toadmin_view(request,theuser=0,
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
# Show ranking distances including predicted paces
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def oterankings_view(request,theuser=0,
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
|
|
|
|
enddate=timezone.now(),
|
|
|
|
@@ -4950,7 +4966,9 @@ def workout_setprivate_view(request,id,
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Joining workout
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workouts_join_view(request):
|
|
|
|
|
promember=0
|
|
|
|
|
if not request.user.is_anonymous():
|
|
|
|
@@ -4994,7 +5012,9 @@ def workouts_join_view(request):
|
|
|
|
|
url = reverse(workouts_join_select)
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workouts_join_select(request,
|
|
|
|
|
startdatestring="",
|
|
|
|
|
enddatestring="",
|
|
|
|
@@ -5013,7 +5033,7 @@ def workouts_join_select(request,
|
|
|
|
|
if 'waterboattype' in request.session:
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'modalities' in request.session:
|
|
|
|
@@ -5023,7 +5043,7 @@ def workouts_join_select(request,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST' and 'daterange' in request.POST:
|
|
|
|
@@ -5048,19 +5068,19 @@ def workouts_join_select(request,
|
|
|
|
|
modality = modalityform.cleaned_data['modality']
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.session['modalities'] = modalities
|
|
|
|
|
request.session['waterboattype'] = waterboattype
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -5166,7 +5186,7 @@ def team_comparison_select(request,
|
|
|
|
|
if 'waterboattype' in request.session:
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in request.session:
|
|
|
|
|
rankingonly = request.session['rankingonly']
|
|
|
|
@@ -5180,7 +5200,7 @@ def team_comparison_select(request,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
|
@@ -5198,12 +5218,12 @@ def team_comparison_select(request,
|
|
|
|
|
modality = modalityform.cleaned_data['modality']
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in modalityform.cleaned_data:
|
|
|
|
@@ -5228,7 +5248,7 @@ def team_comparison_select(request,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -5451,7 +5471,9 @@ def multi_compare_view(request):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Multi Flex Chart with Grouping
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def user_multiflex_select(request,
|
|
|
|
|
startdatestring="",
|
|
|
|
|
enddatestring="",
|
|
|
|
@@ -5494,7 +5516,7 @@ def user_multiflex_select(request,
|
|
|
|
|
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in request.session:
|
|
|
|
|
rankingonly = request.session['rankingonly']
|
|
|
|
@@ -5509,7 +5531,7 @@ def user_multiflex_select(request,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST':
|
|
|
|
@@ -5527,12 +5549,12 @@ def user_multiflex_select(request,
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
rankingonly = modalityform.cleaned_data['rankingonly']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.session['modalities'] = modalities
|
|
|
|
@@ -5561,7 +5583,7 @@ def user_multiflex_select(request,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -5649,7 +5671,9 @@ def user_multiflex_select(request,
|
|
|
|
|
'teams':get_my_teams(request.user),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def multiflex_data(request,userid=0,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
@@ -5880,7 +5904,9 @@ def multiflex_data(request,userid=0,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def multiflex_view(request,userid=0,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
@@ -6045,7 +6071,9 @@ def multiflex_view(request,userid=0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Box plots
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def user_boxplot_select(request,
|
|
|
|
|
startdatestring="",
|
|
|
|
|
enddatestring="",
|
|
|
|
@@ -6056,7 +6084,7 @@ def user_boxplot_select(request,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'workouttypes':['rower','dynamic','slides'],
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'rankingonly':False,
|
|
|
|
|
},
|
|
|
|
|
userid=0):
|
|
|
|
@@ -6093,7 +6121,7 @@ def user_boxplot_select(request,
|
|
|
|
|
|
|
|
|
|
workstrokesonly = not includereststrokes
|
|
|
|
|
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if startdatestring != "":
|
|
|
|
@@ -6122,11 +6150,11 @@ def user_boxplot_select(request,
|
|
|
|
|
modality = optionsform.cleaned_data['modality']
|
|
|
|
|
waterboattype = optionsform.cleaned_data['waterboattype']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in optionsform.cleaned_data:
|
|
|
|
@@ -6149,14 +6177,14 @@ def user_boxplot_select(request,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -6176,7 +6204,7 @@ def user_boxplot_select(request,
|
|
|
|
|
startdate = s
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -6188,7 +6216,7 @@ def user_boxplot_select(request,
|
|
|
|
|
).order_by(
|
|
|
|
|
"-date", "-starttime"
|
|
|
|
|
).exclude(boattype__in=negtypes)
|
|
|
|
|
# workouttypes = [w for w in workouttypes if w not in types.otwtypes]
|
|
|
|
|
# workouttypes = [w for w in workouttypes if w not in mytypes.otwtypes]
|
|
|
|
|
|
|
|
|
|
if rankingonly:
|
|
|
|
|
workouts = [w for w in workouts if w.rankingpiece]
|
|
|
|
@@ -6247,7 +6275,9 @@ def user_boxplot_select(request,
|
|
|
|
|
'teams':get_my_teams(request.user),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def boxplot_view_data(request,userid=0,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
@@ -6344,7 +6374,9 @@ def boxplot_view_data(request,userid=0,
|
|
|
|
|
"div":div,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def boxplot_view(request,userid=0,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
@@ -6645,7 +6677,9 @@ def workouts_view(request,message='',successmessage='',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# List of workouts to compare a selected workout to
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_comparison_list(request,id=0,message='',successmessage='',
|
|
|
|
|
startdatestring="",enddatestring="",
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
|
|
|
@@ -6725,7 +6759,9 @@ def workout_comparison_list(request,id=0,message='',successmessage='',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# List of workouts to compare a selected workout to
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_fusion_list(request,id=0,message='',successmessage='',
|
|
|
|
|
startdatestring="",enddatestring="",
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
|
|
|
@@ -6917,7 +6953,9 @@ def workout_view(request,id=0):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Resets stroke data to raw data (pace)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_undo_smoothenpace_view(
|
|
|
|
|
request,id=0,message="",successmessage=""
|
|
|
|
|
):
|
|
|
|
@@ -6954,7 +6992,9 @@ def workout_undo_smoothenpace_view(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Data smoothing of pace data
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
|
|
|
|
|
@@ -7003,7 +7043,9 @@ def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Process CrewNerd Summary CSV and update summary
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
|
r = getrower(request.user)
|
|
|
|
@@ -7078,7 +7120,9 @@ def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
'id':row.id})
|
|
|
|
|
|
|
|
|
|
# Get weather for given location and date/time
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Pro plan or higher",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def workout_downloadwind_view(request,id=0,
|
|
|
|
|
airportcode=None,
|
|
|
|
|
message="",successmessage=""):
|
|
|
|
@@ -7144,7 +7188,7 @@ def workout_downloadwind_view(request,id=0,
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
# Get weather for given location and date/time
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def workout_downloadmetar_view(request,id=0,
|
|
|
|
|
airportcode=None,
|
|
|
|
|
message="",successmessage=""):
|
|
|
|
@@ -7211,7 +7255,7 @@ def workout_downloadmetar_view(request,id=0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Show form to update wind data
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def workout_wind_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
|
r = getrower(request.user)
|
|
|
|
@@ -7347,7 +7391,7 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Show form to update River stream data (for river dwellers)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def workout_stream_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
row = get_workout(id)
|
|
|
|
|
r = getrower(request.user)
|
|
|
|
@@ -7668,7 +7712,7 @@ def workout_geeky_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
messages.error(request,message)
|
|
|
|
|
messages.info(request,successmessage)
|
|
|
|
|
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
return render(request,
|
|
|
|
|
'otwgeeky.html',
|
|
|
|
|
{'workout':row,
|
|
|
|
@@ -7742,7 +7786,7 @@ def instroke_chart(request,id=0,metric=''):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Cumulative stats page
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def cumstats(request,theuser=0,
|
|
|
|
|
startdate=timezone.now()-datetime.timedelta(days=30),
|
|
|
|
|
enddate=timezone.now(),
|
|
|
|
@@ -7752,7 +7796,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
options={
|
|
|
|
|
'includereststrokes':False,
|
|
|
|
|
'workouttypes':['rower','dynamic','slides'],
|
|
|
|
|
'waterboattype':types.waterboattype,
|
|
|
|
|
'waterboattype':mytypes.waterboattype,
|
|
|
|
|
'rankingonly':False,
|
|
|
|
|
}):
|
|
|
|
|
|
|
|
|
@@ -7762,7 +7806,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
if 'waterboattype' in request.session:
|
|
|
|
|
waterboattype = request.session['waterboattype']
|
|
|
|
|
else:
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'rankingonly' in request.session:
|
|
|
|
@@ -7777,7 +7821,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
else:
|
|
|
|
|
modality = modalities[0]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
modality = 'all'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -7794,7 +7838,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
|
|
|
|
|
workstrokesonly = not includereststrokes
|
|
|
|
|
|
|
|
|
|
waterboattype = types.waterboattype
|
|
|
|
|
waterboattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if startdatestring != "":
|
|
|
|
@@ -7829,12 +7873,12 @@ def cumstats(request,theuser=0,
|
|
|
|
|
waterboattype = modalityform.cleaned_data['waterboattype']
|
|
|
|
|
rankingonly = modalityform.cleaned_data['rankingonly']
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
|
if modality != 'water':
|
|
|
|
|
waterboattype = [b[0] for b in types.boattypes]
|
|
|
|
|
waterboattype = [b[0] for b in mytypes.boattypes]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.session['modalities'] = modalities
|
|
|
|
@@ -7861,7 +7905,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
negtypes = []
|
|
|
|
|
for b in types.boattypes:
|
|
|
|
|
for b in mytypes.boattypes:
|
|
|
|
|
if b[0] not in waterboattype:
|
|
|
|
|
negtypes.append(b[0])
|
|
|
|
|
|
|
|
|
@@ -7887,7 +7931,7 @@ def cumstats(request,theuser=0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if modality == 'all':
|
|
|
|
|
modalities = [m[0] for m in types.workouttypes]
|
|
|
|
|
modalities = [m[0] for m in mytypes.workouttypes]
|
|
|
|
|
else:
|
|
|
|
|
modalities = [modality]
|
|
|
|
|
|
|
|
|
@@ -8347,7 +8391,7 @@ def workout_advanced_view(request,id=0,message="",successmessage=""):
|
|
|
|
|
messages.info(request,successmessage)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
return render(request,
|
|
|
|
|
'advancedotw.html',
|
|
|
|
|
{'workout':row,
|
|
|
|
@@ -8620,7 +8664,7 @@ def workout_workflow_view(request,id):
|
|
|
|
|
aantalcomments = len(comments)
|
|
|
|
|
|
|
|
|
|
workouttype = 'ote'
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
workouttype = 'otw'
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
@@ -8730,7 +8774,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
|
|
|
|
mayedit=1
|
|
|
|
|
|
|
|
|
|
workouttype = 'ote'
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
workouttype = 'otw'
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
@@ -8904,7 +8948,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
|
|
|
|
noylist = ["time","distance"]
|
|
|
|
|
axchoicesbasic.pop("cumdist")
|
|
|
|
|
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
for name,d in rowingmetrics:
|
|
|
|
|
if d['mode'] == 'erg':
|
|
|
|
|
axchoicespro.pop(name)
|
|
|
|
@@ -11507,7 +11551,7 @@ def workout_summary_restore_view(request,id,message="",successmessage=""):
|
|
|
|
|
r.pw_tr,r.pw_an])/r.ftp
|
|
|
|
|
|
|
|
|
|
ftp = float(r.ftp)
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
ftp = ftp*(100.-r.otwslack)/100.
|
|
|
|
|
|
|
|
|
|
rr = rrower(hrmax=r.max,hrut2=r.ut2,
|
|
|
|
@@ -11542,7 +11586,7 @@ def workout_summary_restore_view(request,id,message="",successmessage=""):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
# Split a workout
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def workout_split_view(request,id=id):
|
|
|
|
|
row = get_workout_permitted(request.user,id)
|
|
|
|
|
|
|
|
|
@@ -11633,7 +11677,7 @@ def workout_split_view(request,id=id):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Fuse two workouts
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",redirect_field_name=None)
|
|
|
|
|
@user_passes_test(ispromember,login_url="/rowers/promembership",message="This functionality requires a Pro plan or higher",redirect_field_name=None)
|
|
|
|
|
def workout_fusion_view(request,id1=0,id2=1):
|
|
|
|
|
|
|
|
|
|
r = getrower(request.user)
|
|
|
|
@@ -11746,7 +11790,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|
|
|
|
r.pw_tr,r.pw_an])/r.ftp
|
|
|
|
|
|
|
|
|
|
ftp = float(r.ftp)
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
ftp = ftp*(100.-r.otwslack)/100.
|
|
|
|
|
|
|
|
|
|
rr = rrower(hrmax=r.max,hrut2=r.ut2,
|
|
|
|
@@ -13038,7 +13082,7 @@ def strokedatajson(request,id):
|
|
|
|
|
r.pw_tr,r.pw_an])/r.ftp
|
|
|
|
|
|
|
|
|
|
ftp = float(r.ftp)
|
|
|
|
|
if row.workouttype in types.otwtypes:
|
|
|
|
|
if row.workouttype in mytypes.otwtypes:
|
|
|
|
|
ftp = ftp*(100.-r.otwslack)/100.
|
|
|
|
|
|
|
|
|
|
rr = rrower(hrmax=r.max,hrut2=r.ut2,
|
|
|
|
@@ -13755,6 +13799,7 @@ def agegrouprecordview(request,sex='male',weightcategory='hwt',
|
|
|
|
|
|
|
|
|
|
# Cloning sessions
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def plannedsession_multiclone_view(
|
|
|
|
|
request,
|
|
|
|
@@ -13867,6 +13912,7 @@ def plannedsession_multiclone_view(
|
|
|
|
|
|
|
|
|
|
# Individual user creates training for himself
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def plannedsession_create_view(request,
|
|
|
|
|
userid=0):
|
|
|
|
@@ -14000,6 +14046,7 @@ def plannedsession_create_view(request,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def plannedsession_multicreate_view(request,
|
|
|
|
|
teamid=0,userid=0,extrasessions=0):
|
|
|
|
@@ -14709,6 +14756,7 @@ def plannedsessions_manage_view(request,userid=0,
|
|
|
|
|
# Clone an existing planned session
|
|
|
|
|
# need clarity on cloning behavior time shift
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def plannedsession_clone_view(request,id=0,userid=0):
|
|
|
|
|
|
|
|
|
@@ -14772,6 +14820,7 @@ def plannedsession_clone_view(request,id=0,userid=0):
|
|
|
|
|
|
|
|
|
|
# Edit an existing planned session
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership/",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def plannedsession_edit_view(request,id=0,userid=0):
|
|
|
|
|
|
|
|
|
@@ -15281,12 +15330,12 @@ def virtualevent_view(request,id=0):
|
|
|
|
|
try:
|
|
|
|
|
boattype = cd['boattype']
|
|
|
|
|
except KeyError:
|
|
|
|
|
boattype = types.waterboattype
|
|
|
|
|
boattype = mytypes.waterboattype
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
boatclass = cd['boatclass']
|
|
|
|
|
except KeyError:
|
|
|
|
|
boatclass = [t for t in types.otwtypes]
|
|
|
|
|
boatclass = [t for t in mytypes.otwtypes]
|
|
|
|
|
|
|
|
|
|
age_min = cd['age_min']
|
|
|
|
|
age_max = cd['age_max']
|
|
|
|
@@ -15403,7 +15452,7 @@ def virtualevent_addboat_view(request,id=0):
|
|
|
|
|
|
|
|
|
|
boattypes = [record.boattype for record in records]
|
|
|
|
|
boatclasses = [record.boatclass for record in records]
|
|
|
|
|
allowedboats = tuple([ type for type in types.boattypes if type[0] not in boattypes] )
|
|
|
|
|
allowedboats = tuple([ type for type in mytypes.boattypes if type[0] not in boattypes] )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# we're still here
|
|
|
|
@@ -15908,7 +15957,9 @@ def virtualevent_submit_result_view(request,id=0):
|
|
|
|
|
'w_form':w_form,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership", redirect_field_name=None)
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def rower_create_trainingplan(request,userid=0):
|
|
|
|
|
|
|
|
|
|
therower = getrequestrower(request,userid=userid)
|
|
|
|
@@ -15979,7 +16030,9 @@ def rower_create_trainingplan(request,userid=0):
|
|
|
|
|
'targetform':targetform,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership", redirect_field_name=None)
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def rower_delete_trainingtarget(request,id=0):
|
|
|
|
|
try:
|
|
|
|
|
target = TrainingTarget.objects.get(id=id)
|
|
|
|
@@ -15997,7 +16050,9 @@ def rower_delete_trainingtarget(request,id=0):
|
|
|
|
|
return HttpResponseRedirect(url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership", redirect_field_name=None)
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def rower_delete_trainingplan(request,id=0):
|
|
|
|
|
try:
|
|
|
|
|
plan = TrainingPlan.objects.get(id=id)
|
|
|
|
@@ -16307,7 +16362,9 @@ class MacroCycleDelete(DeleteView):
|
|
|
|
|
return obj
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership", redirect_field_name=None)
|
|
|
|
|
@user_passes_test(hasplannedsessions,login_url="/rowers/promembership",
|
|
|
|
|
message="This functionality requires a Coach or Self-Coach plan",
|
|
|
|
|
redirect_field_name=None)
|
|
|
|
|
def rower_trainingplan_view(request,
|
|
|
|
|
id=0,
|
|
|
|
|
userid=0,
|
|
|
|
|