added default time zone setting
This commit is contained in:
@@ -54,6 +54,10 @@ database_url = 'mysql://{user}:{password}@{host}:{port}/{database_name}'.format(
|
||||
if settings.DEBUG or user=='':
|
||||
database_url = 'sqlite:///db.sqlite3'
|
||||
|
||||
timezones = (
|
||||
(x,x) for x in pytz.common_timezones
|
||||
)
|
||||
|
||||
class UserFullnameChoiceField(forms.ModelChoiceField):
|
||||
def label_from_instance(self,obj):
|
||||
return obj.get_full_name()
|
||||
@@ -290,6 +294,11 @@ class Rower(models.Model):
|
||||
|
||||
team = models.ManyToManyField(Team,blank=True)
|
||||
|
||||
# Export and Time Zone Settings
|
||||
defaulttimezone = models.CharField(default='UTC',max_length=100,
|
||||
choices=timezones,
|
||||
verbose_name='Default Time Zone')
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username
|
||||
|
||||
@@ -389,10 +398,10 @@ def checkworkoutuser(user,workout):
|
||||
except Rower.DoesNotExist:
|
||||
return False
|
||||
|
||||
|
||||
timezones = (
|
||||
(x,x) for x in pytz.common_timezones
|
||||
)
|
||||
|
||||
|
||||
# Workout
|
||||
class Workout(models.Model):
|
||||
@@ -809,7 +818,7 @@ class RowerPowerZonesForm(ModelForm):
|
||||
class AccountRowerForm(ModelForm):
|
||||
class Meta:
|
||||
model = Rower
|
||||
fields = ['weightcategory','getemailnotifications']
|
||||
fields = ['weightcategory','getemailnotifications','defaulttimezone']
|
||||
|
||||
class UserForm(ModelForm):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user