Private
Public Access
1
0
This commit is contained in:
2024-01-22 21:12:21 +01:00
parent 7b84f659c5
commit 61089d4c2b
3 changed files with 13 additions and 9 deletions

View File

@@ -1111,6 +1111,7 @@ class PowerIntervalUpdateForm(forms.Form):
boattypes = mytypes.boattypes boattypes = mytypes.boattypes
ergtypes = mytypes.ergtypes
workouttypes = mytypes.workouttypes workouttypes = mytypes.workouttypes
ww = list(workouttypes) ww = list(workouttypes)
ww.append(tuple(('all', 'All'))) ww.append(tuple(('all', 'All')))
@@ -1143,7 +1144,7 @@ class AnalysisOptionsForm(forms.Form):
modality = forms.ChoiceField(choices=workouttypes, modality = forms.ChoiceField(choices=workouttypes,
label='Workout Type', label='Workout Type',
initial='all') initial='all')
waterboattype = forms.MultipleChoiceField(choices=boattypes, waterboattype = forms.MultipleChoiceField(choices=boattypes+ergtypes,
label='Water Boat Type', label='Water Boat Type',
initial=mytypes.waterboattype) initial=mytypes.waterboattype)

View File

@@ -3582,7 +3582,7 @@ class Workout(models.Model):
boattype = self.boattype boattype = self.boattype
workouttype = self.workouttype workouttype = self.workouttype
if workouttype != 'water': if workouttype not in ['water','rower']:
try: try:
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format( stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
d=date.strftime('%Y-%m-%d'), d=date.strftime('%Y-%m-%d'),

View File

@@ -100,6 +100,11 @@ def analysis_new(request,
waterboattype = mytypes.waterboattype waterboattype = mytypes.waterboattype
try:
waterboattype = options['waterboattype']
except KeyError:
pass
if request.method == 'POST': if request.method == 'POST':
thediv = get_call() thediv = get_call()
dateform = DateRangeForm(request.POST) dateform = DateRangeForm(request.POST)
@@ -122,7 +127,7 @@ def analysis_new(request,
modalities = [m[0] for m in mytypes.workouttypes] modalities = [m[0] for m in mytypes.workouttypes]
else: # pragma: no cover else: # pragma: no cover
modalities = [modality] modalities = [modality]
if modality != 'water': if modality not in ['water','rower']:
waterboattype = [b[0] for b in mytypes.boattypes] waterboattype = [b[0] for b in mytypes.boattypes]
options['modalities'] = modalities options['modalities'] = modalities
@@ -133,7 +138,7 @@ def analysis_new(request,
except KeyError: except KeyError:
worldclass = False worldclass = False
options['cpoverlay'] = worldclass options['cpoverlay'] = worldclass
chartform = AnalysisChoiceForm(request.POST) chartform = AnalysisChoiceForm(request.POST)
if chartform.is_valid(): if chartform.is_valid():
options['form'] = chartform.cleaned_data options['form'] = chartform.cleaned_data
@@ -160,6 +165,9 @@ def analysis_new(request,
for b in mytypes.boattypes: for b in mytypes.boattypes:
if b[0] not in waterboattype: # pragma: no cover if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0]) negtypes.append(b[0])
for b in mytypes.ergtypes:
if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0])
startdate = datetime.datetime.combine(startdate, datetime.time()) startdate = datetime.datetime.combine(startdate, datetime.time())
enddate = datetime.datetime.combine(enddate, datetime.time(23, 59, 59)) enddate = datetime.datetime.combine(enddate, datetime.time(23, 59, 59))
@@ -179,11 +187,6 @@ def analysis_new(request,
except (ValueError, AttributeError): # pragma: no cover except (ValueError, AttributeError): # pragma: no cover
pass pass
negtypes = []
for b in mytypes.boattypes:
if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0])
rankingtypes = [False,True] rankingtypes = [False,True]
if ranking: if ranking:
rankingtypes = [True] rankingtypes = [True]