Changeset 1183d5a in OpenWorkouts-current for ow/views/user.py
- Timestamp:
- Jan 31, 2019, 3:25:08 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 3357e47
- Parents:
- ed7e9d7 (diff), dbfab70 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/views/user.py
red7e9d7 r1183d5a 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.