Closed MarisiaS closed 6 months ago
Could a meet have more than one record of the same event type associated?
I think that's ok because they could have semifinal and final for the same event. But maybe then we should add an extra identifier to the name.
This PR addresses issue #51
Implementation
Implemented the MeetEvent model with the following fields:
Added a unique constrain to meet and num_event
Generated with command
makemigrations
.MeetEventSerializer
based onModelSerializer
to display almost all the information about an event.MeetEventPatchSerializer
based onModelSerializer
to display onlynum_event
.Created an APIView named MeetEventView with:
get
method to list all the events associated with a given swim meet sorted by num_event. This view uses theMeetEventSerializer
.post
method to add a new event to a given swim meet. This view also uses theMeetEventSerializer
.patch
method to delete a event from a given swim meet and update the num_event for the next events. This view uses theMeetEventPatchSerializer
.Added the following endpoint:
meet_event/<int:meet_id>/
usesMeetEventView
.Swagger
All new endpoints are accessible through Swagger. Each endpoint has been tested successfully, including listing all events associated with a swim meet, adding an event to a swim meet, and deleting an event from a swim meet.