Private
Public Access
1
0

added reststrokes to favoritechart settings

This commit is contained in:
Sander Roosendaal
2016-12-08 11:50:58 +01:00
parent 92cb0ca0cb
commit 7dfff7e3df
5 changed files with 60 additions and 16 deletions

View File

@@ -157,12 +157,15 @@ class FavoriteChart(models.Model):
workouttype = models.CharField(max_length=50,choices=workouttypechoices,
default='both',
verbose_name='Workout Type')
reststrokes = models.BooleanField(default=True,verbose_name="Incl. Rest")
user = models.ForeignKey(Rower)
class FavoriteForm(ModelForm):
class Meta:
model = FavoriteChart
fields = ['xparam','yparam1','yparam2','plottype','workouttype']
fields = ['xparam','yparam1','yparam2',
'plottype','workouttype','reststrokes']
class BaseFavoriteFormSet(BaseFormSet):
def clean(self):
@@ -175,7 +178,8 @@ class BaseFavoriteFormSet(BaseFormSet):
yparam1 = form.cleaned_data['yparam1']
yparam2 = form.cleaned_data['yparam2']
plottype = form.cleaned_data['plottype']
reststrokes = form.cleaned_data['reststrokes']
if not xparam:
raise forms.ValidationError(
'Must have x parameter.',