- Timestamp:
- Dec 21, 2018, 11:00:25 AM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- fe6089a
- Parents:
- d507f75
- Location:
- ow/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/models/user.py
rd507f75 r31adfa5 33 33 self.gender = kw.get('gender', 'female') 34 34 self.picture = kw.get('picture', None) # blob 35 self.timezone = kw.get('timezone', 'UTC') 35 36 self.__password = None 36 37 self.last_workout_id = 0 -
ow/models/workout.py
rd507f75 r31adfa5 3 3 from decimal import Decimal 4 4 5 import pytz 5 6 import gpxpy 6 7 from repoze.folder import Folder … … 74 75 return self.start.strftime('%H:%M') 75 76 77 def start_in_timezone(self, timezone): 78 """ 79 Return a string representation of the start date and time, 80 localized into the given timezone 81 """ 82 _start = self.start.astimezone(pytz.timezone(timezone)) 83 return _start.strftime('%d/%m/%Y %H:%M (%Z)') 84 85 def end_in_timezone(self, timezone): 86 """ 87 Return a string representation of the end date and time, 88 localized into the given timezone 89 """ 90 _end = self.end.astimezone(pytz.timezone(timezone)) 91 return _end.strftime('%d/%m/%Y %H:%M (%Z)') 92 76 93 def split_duration(self): 77 94 hours, remainder = divmod(int(self.duration.total_seconds()), 3600)
Note: See TracChangeset
for help on using the changeset viewer.