backend/api/CustomField.py
Created custom field subclass HeatDurationField of DurationField.
Added the following option:
NT corresponds to 200 days. It will be use when an athlete does not have a seed time for an event.
NS corresponds to 300 days. It will be use when an athlete does not show up for a heat.
DQ corresponds to 400 days. It will be use when an athlete gets disqualified for a heat.
backend/api/serializers/AthleteSeedTimeSerializer.py
Created two serializer:
AthleteSeedTimeSerializer: Used to display athlete ID, athlete full name and athlete seed time.
UpdateAthleteSeedTimeSerializer: Used to record a time for an specific athlete. The date needed are athlete, date. time. The event_type has to be pass as a context.
Validates that the time is positive. And includes a create function to register the record.
backend/api/views/AtheleteSeedTimeView.py
Created AthleteSeedTimeView. This view contains two methods:
Get: Given an event_id, uses AthleteSeedTimeSerializer to display the seed time of the athletes in the group corresponding to the given event.
Post: Uses UpdateAthleteSeedTimeSerializer to add a record on TimeRecord for a specific athlete.
This PR addresses issue #56
Implementation
HeatDurationField
ofDurationField
.Added the following option:
NT
corresponds to 200 days. It will be use when an athlete does not have a seed time for an event.NS
corresponds to 300 days. It will be use when an athlete does not show up for a heat.DQ
corresponds to 400 days. It will be use when an athlete gets disqualified for a heat.AthleteSeedTimeSerializer
: Used to display athlete ID, athlete full name and athlete seed time.UpdateAthleteSeedTimeSerializer
: Used to record a time for an specific athlete. The date needed are athlete, date. time. Theevent_type
has to be pass as a context. Validates that the time is positive. And includes acreate
function to register the record.event_id
, usesAthleteSeedTimeSerializer
to display the seed time of the athletes in the group corresponding to the given event.UpdateAthleteSeedTimeSerializer
to add a record onTimeRecord
for a specific athlete.seed_times/<int:event_id>
endpoint