Changeset e52a502 in OpenWorkouts-current for ow/views/workout.py
- Timestamp:
- Apr 19, 2019, 5:03:49 PM (5 years ago)
- Branches:
- current
- Children:
- 42baca4
- Parents:
- 39dc0a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/views/workout.py
r39dc0a6 re52a502 41 41 # "bind" to the object, we do calculate both the full duration in 42 42 # seconds and the full datetime "start" and we save that 43 # 44 # exclude also the distance field, we have to convert to decimal 45 # before adding it 43 46 excluded = ['duration_hours', 'duration_minutes', 'duration_seconds', 44 'start_date', 'start_time' ]47 'start_date', 'start_time', 'distance'] 45 48 workout = form.bind(Workout(), exclude=excluded) 46 49 duration = timedelta(hours=form.data['duration_hours'], … … 60 63 workout.title += ' ' + workout.sport 61 64 workout.title += ' ' + _('workout') 65 workout.distance = Decimal(form.data['distance']) 62 66 context.add_workout(workout) 63 67 return HTTPFound(location=request.resource_url(workout))
Note: See TracChangeset
for help on using the changeset viewer.