Closed MarisiaS closed 6 months ago
Just a couple of observations: Issue #27 calls for fixtures, those are not included in this PR. I see you added search and sort functionality, should we add then the insensitive collation in the model?
I just added sorting by date, so the insensitive collation is not needed.
Just a couple of observations: Issue #27 calls for fixtures, those are not included in this PR. I see you added search and sort functionality, should we add then the insensitive collation in the model?
I just added sorting by date, so the insensitive collation is not needed.
Sorry, I got confuse with name but name is a search filter. :)
This PR addresses issue #27
Implementation
backend/api/migrations/0011_swimmeet.py After creating the model, I ran the
makemigrations
command and the migration for the SwimMeet model was created.backend/api/serializers/SwimMeetSerializer.py Created a Model serializer for the SwimMeet model. Included all the fields plus the site name.
backend/api/views/EventTypeView.py Created a basic Model View set for SwimMeet. The data is order by date. Search by name is allow
backend/api/urls.py Added a router to generate the endpoints for SwimMeet.
backend/api/fixtures/swim_meet.json
Added 2 swim meets
Swagger
The endpoints are accessible through Swagger.
I tried each of the new endpoints successfully. I was able to create, delete, patch and get an swim meet. When posting and patching, I got the expected error for entering invalid data.