Changeset dbfab70 in OpenWorkouts-current for ow/views/user.py
- Timestamp:
- Jan 31, 2019, 12:33:38 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 1183d5a, 9ab0fe3
- Parents:
- 8fedd17
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/views/user.py
r8fedd17 rdbfab70 166 166 """ 167 167 now = datetime.now(timezone.utc) 168 return { 169 'current_month': now.strftime('%Y-%m') 168 year = int(request.GET.get('year', now.year)) 169 month = int(request.GET.get('month', now.month)) 170 return { 171 'workouts': context.workouts(year, month), 172 'current_month': '{year}-{month}'.format( 173 year=str(year), month=str(month).zfill(2)) 170 174 } 171 175 … … 280 284 'distance': int(round(stats[month]['distance'])), 281 285 'elevation': int(stats[month]['elevation']), 282 'workouts': stats[month]['workouts'] 286 'workouts': stats[month]['workouts'], 287 'url': request.resource_url( 288 context, 'profile', 289 query={'year': str(month[0]), 'month': str(month[1])}, 290 anchor='workouts') 283 291 } 284 292 json_stats.append(month_stats)
Note: See TracChangeset
for help on using the changeset viewer.