removing onlyranking
This commit is contained in:
@@ -1057,9 +1057,7 @@ class AnalysisOptionsForm(forms.Form):
|
||||
waterboattype = forms.MultipleChoiceField(choices=boattypes,
|
||||
label='Water Boat Type',
|
||||
initial = mytypes.waterboattype)
|
||||
rankingonly = forms.BooleanField(initial=False,
|
||||
label='Only Ranking Pieces',
|
||||
required=False)
|
||||
|
||||
|
||||
|
||||
# form to select modality and boat type for trend flex
|
||||
@@ -1070,17 +1068,14 @@ class TrendFlexModalForm(forms.Form):
|
||||
waterboattype = forms.MultipleChoiceField(choices=boattypes,
|
||||
label='Water Boat Type',
|
||||
initial = mytypes.waterboattype)
|
||||
rankingonly = forms.BooleanField(initial=False,
|
||||
label='Only Ranking Pieces',
|
||||
required=False)
|
||||
|
||||
|
||||
|
||||
|
||||
# This form sets options for the summary stats page
|
||||
class StatsOptionsForm(forms.Form):
|
||||
includereststrokes = forms.BooleanField(initial=False,label='Include Rest Strokes',required=False)
|
||||
rankingonly = forms.BooleanField(initial=False,
|
||||
label='Only Ranking Pieces',required=False)
|
||||
|
||||
water = forms.BooleanField(initial=False,required=False)
|
||||
waterboattype = forms.MultipleChoiceField(choices=boattypes,
|
||||
label='Water Boat Type',
|
||||
|
||||
@@ -261,14 +261,10 @@ urlpatterns = [
|
||||
views.agegrouprecordview,name='agegrouprecordview'),
|
||||
re_path(r'^agegrouprecords/$',
|
||||
views.agegrouprecordview,name='agegrouprecordview'),
|
||||
re_path(r'^list-workouts/ranking/$',views.workouts_view,{'rankingonly':True},
|
||||
name='workouts_view'),
|
||||
re_path(r'^list-workouts/team/(?P<teamid>\d+)/$',views.workouts_view,
|
||||
name='workouts_view'),
|
||||
re_path(r'^(?P<rowerid>\d+)/list-workouts/$',views.workouts_view,
|
||||
name='workouts_view'),
|
||||
re_path(r'^list-workouts/ranking/user/(?P<userid>\d+)/$',views.workouts_view,{'rankingonly':True},
|
||||
name='workouts_view'),
|
||||
re_path(r'^list-workouts/user/(?P<userid>\d+)/$',views.workouts_view,
|
||||
name='workouts_view'),
|
||||
re_path(r'^virtualevents/$',views.virtualevents_view,name='virtualevents_view'),
|
||||
|
||||
@@ -867,7 +867,6 @@ defaultoptions = {
|
||||
'includereststrokes': False,
|
||||
'workouttypes':['rower','dynamic','slides'],
|
||||
'waterboattype': mytypes.waterboattype,
|
||||
'rankingonly': False,
|
||||
'function':'boxplot'
|
||||
}
|
||||
|
||||
@@ -901,12 +900,6 @@ def video_selectworkout(request,userid=0):
|
||||
modality = 'all'
|
||||
|
||||
|
||||
|
||||
try:
|
||||
rankingonly = options['rankingonly']
|
||||
except KeyError: # pragma: no cover
|
||||
rankingonly = False
|
||||
|
||||
query = request.GET.get('q')
|
||||
if query: # pragma: no cover
|
||||
query_list = query.split()
|
||||
@@ -1002,9 +995,6 @@ def video_selectworkout(request,userid=0):
|
||||
).exclude(boattype__in=negtypes)
|
||||
|
||||
|
||||
if rankingonly: # pragma: no cover
|
||||
workouts = workouts.exclude(rankingpiece=False)
|
||||
|
||||
startdatestring = startdate.strftime('%Y-%m-%d')
|
||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||
request.session['startdate'] = startdatestring
|
||||
@@ -1276,11 +1266,6 @@ def team_comparison_select(request,
|
||||
else:
|
||||
waterboattype = mytypes.waterboattype
|
||||
|
||||
if 'rankingonly' in request.session: # pragma: no cover
|
||||
rankingonly = request.session['rankingonly']
|
||||
else:
|
||||
rankingonly = False
|
||||
|
||||
if 'modalities' in request.session:
|
||||
modalities = request.session['modalities']
|
||||
if len(modalities) > 1: # pragma: no cover
|
||||
@@ -1314,11 +1299,6 @@ def team_comparison_select(request,
|
||||
waterboattype = [b[0] for b in mytypes.boattypes]
|
||||
|
||||
|
||||
if 'rankingonly' in modalityform.cleaned_data:
|
||||
rankingonly = modalityform.cleaned_data['rankingonly']
|
||||
else: # pragma: no cover
|
||||
rankingonly = False
|
||||
|
||||
request.session['modalities'] = modalities
|
||||
request.session['waterboattype'] = waterboattype
|
||||
else:
|
||||
@@ -1329,7 +1309,6 @@ def team_comparison_select(request,
|
||||
modalityform = TrendFlexModalForm(initial={
|
||||
'modality':modality,
|
||||
'waterboattype':waterboattype,
|
||||
'rankingonly':rankingonly,
|
||||
})
|
||||
|
||||
|
||||
@@ -1388,8 +1367,6 @@ def team_comparison_select(request,
|
||||
startdatetime__lte=enddate,
|
||||
workouttype__in=modalities).order_by("-date", "-starttime").exclude(boattype__in=negtypes)
|
||||
|
||||
if rankingonly: # pragma: no cover
|
||||
workouts = workouts.exclude(rankingpiece=False)
|
||||
|
||||
query = request.GET.get('q')
|
||||
if query: # pragma: no cover
|
||||
@@ -2208,7 +2185,7 @@ def multi_compare_view(request,id=0,userid=0):
|
||||
# List Workouts
|
||||
@login_required()
|
||||
def workouts_view(request,message='',successmessage='',
|
||||
teamid=0,rankingonly=False,rowerid=0,userid=0):
|
||||
teamid=0,rowerid=0,userid=0):
|
||||
|
||||
startdate,enddate = get_dates_timeperiod(request,defaulttimeperiod='lastyear')
|
||||
request.session['referer'] = absolute(request)['PATH']
|
||||
@@ -2333,8 +2310,6 @@ def workouts_view(request,message='',successmessage='',
|
||||
g_startdate = (timezone.now()-timedelta(days=15))
|
||||
|
||||
|
||||
if rankingonly:
|
||||
workouts = workouts.exclude(rankingpiece=False)
|
||||
|
||||
workoutsnohr = workouts.exclude(averagehr__isnull=False)
|
||||
for w in workoutsnohr: # pragma: no cover
|
||||
@@ -2413,7 +2388,6 @@ def workouts_view(request,message='',successmessage='',
|
||||
'enddate':enddate,
|
||||
'announcements':announcements[0:4],
|
||||
'team':theteam,
|
||||
'rankingonly':rankingonly,
|
||||
'teams':get_my_teams(request.user),
|
||||
'interactiveplot':script,
|
||||
'the_div':div,
|
||||
|
||||
Reference in New Issue
Block a user