adding grid user settings
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user