adding automatic charting
This commit is contained in:
@@ -764,6 +764,14 @@ class Rower(models.Model):
|
||||
(365,'a year')
|
||||
)
|
||||
|
||||
plotchoices = (
|
||||
('timeplot','Time Plot'),
|
||||
('distanceplot','Distance Plot'),
|
||||
('pieplot','Heart Rate Pie Chart'),
|
||||
('hrpieplot','Power Pie Chart'),
|
||||
('None','None'),
|
||||
)
|
||||
|
||||
user = models.OneToOneField(User,on_delete=models.CASCADE)
|
||||
|
||||
#billing details
|
||||
@@ -969,6 +977,10 @@ class Rower(models.Model):
|
||||
slowpaceotw = models.DurationField(default=otwpaceslow,verbose_name='Slowest OTW Pace')
|
||||
fastpaceotw = models.DurationField(default=otwpacefast,verbose_name='Fastest OTW Pace')
|
||||
|
||||
staticchartonupload = models.CharField(default='None',choices=plotchoices,
|
||||
max_length=100,
|
||||
verbose_name='Generate a static chart automatically on upload')
|
||||
|
||||
# Auto Join
|
||||
autojoin = models.BooleanField(default=False,verbose_name='Auto Join Workout Segments')
|
||||
|
||||
@@ -3001,7 +3013,7 @@ def auto_delete_file_on_delete(sender, instance, **kwargs):
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@receiver(models.signals.post_delete,sender=Workout)
|
||||
def update_duplicates_on_delete(sender, instance, **kwargs):
|
||||
@@ -3790,7 +3802,7 @@ class AccountRowerForm(ModelForm):
|
||||
class StaticChartRowerForm(ModelForm):
|
||||
class Meta:
|
||||
model = Rower
|
||||
fields = ['staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw']
|
||||
fields = ['staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw','staticchartonupload']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StaticChartRowerForm, self).__init__(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user