Private
Public Access
1
0

adding grid user settings

This commit is contained in:
Sander Roosendaal
2020-05-03 11:11:18 +02:00
parent eaace7c426
commit 0f3d697057
7 changed files with 67 additions and 18 deletions

View File

@@ -697,6 +697,14 @@ class Rower(models.Model):
('Workout','Workout'),
('Yoga','Yoga'),
)
gridtypes = (
('none',None),
('both','both'),
('x','x'),
('y','y'),
)
user = models.OneToOneField(User,on_delete=models.CASCADE)
#billing details
@@ -880,6 +888,10 @@ class Rower(models.Model):
showfavoritechartnotes = models.BooleanField(default=True,
verbose_name='Show Notes for Favorite Charts')
# Static chart settings
staticgrids = models.CharField(default=None,choices=gridtypes,null=True,max_length=50,
verbose_name='Chart Grid')
def __str__(self):
return self.user.first_name+' '+self.user.last_name
@@ -3438,7 +3450,15 @@ class AccountRowerForm(ModelForm):
if 'coach' not in self.instance.rowerplan:
self.fields.pop('offercoaching')
# Form to set static chart settings
class StaticChartRowerForm(ModelForm):
class Meta:
model = Rower
fields = ['staticgrids']
def __init__(self, *args, **kwargs):
super(StaticChartRowerForm, self).__init__(*args, **kwargs)
self.fields['staticgrids'].required = False
class UserForm(ModelForm):