Private
Public Access
1
0

testing c2 import

This commit is contained in:
Sander Roosendaal
2021-05-12 06:52:53 +02:00
parent 2235b28cd5
commit 4afaa5fd10
8 changed files with 40 additions and 39 deletions

View File

@@ -994,32 +994,6 @@ class PowerIntervalUpdateForm(forms.Form):
activeminutesmin = forms.IntegerField(required=False,initial=0,widget=forms.HiddenInput())
activeminutesmax = forms.IntegerField(required=False,initial=0,widget=forms.HiddenInput())
# Form used to update interval stats
class IntervalUpdateForm(forms.Form):
def __init__(self, *args, **kwargs):
typechoices = (
(1,'single time'),
(2,'single distance'),
(3,'rest (time based)'),
(3,'rest (distance based)'),
(4,'work (time based)'),
(5,'work (distance based)'),
)
aantal = int(kwargs.pop('aantal'))
super(IntervalUpdateForm, self).__init__(*args, **kwargs)
for i in range(aantal):
self.fields['intervalt_%s' % i] = forms.DurationField(label='Time '+str(i+1))
self.fields['intervald_%s' % i] = forms.IntegerField(label='Distance '+str(i+1))
self.fields['type_%s' % i] = forms.ChoiceField(choices=typechoices,
required=True,
initial=4,
label = 'Type '+str(i+1))
self.fields['intervalt_%s' % i].widget.attrs['style'] = 'width:76px; height: 16px;'
self.fields['intervald_%s' % i].widget.attrs['style'] = 'width:76px; height: 16px;'
self.fields['type_%s' % i].widget.attrs['style'] = 'width:156px; height: 22px;'
self.fields['intervald_%s' % i].widget = forms.TimeInput(format='%H:%M:%S.%f')
boattypes = mytypes.boattypes
workouttypes = mytypes.workouttypes