From b3f488ef2bd7bc2b66ae2269d92fcd2b0f27c004 Mon Sep 17 00:00:00 2001 From: borzechof99 <borzechof99@mi.fu-berlin.de> Date: Fri, 25 Jun 2021 21:21:09 +0200 Subject: [PATCH] Add Todos at various points --- unisportomat/quiz/models.py | 3 ++- unisportomat/quiz/serializers.py | 1 + unisportomat/quiz/views.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/unisportomat/quiz/models.py b/unisportomat/quiz/models.py index 5a4db07..2a0fd62 100644 --- a/unisportomat/quiz/models.py +++ b/unisportomat/quiz/models.py @@ -6,7 +6,7 @@ from django.db import models def validate_rating(value): """ - TODO: Validations are only run when using Model Forms. + TODO: Validations are only run when using Model Forms. Maybe do that, if there is time. """ if not ((10 >= value >= 1) or value == -1): @@ -133,6 +133,7 @@ class Criterion(models.Model): def get_active_sum(self): """ Get Number of Sports with Rating larger than 1 and the cumulated sum of all ratings + TODO: Think about Usefulness of Rating Sums with 1 as Min Value """ num_active = 0 diff --git a/unisportomat/quiz/serializers.py b/unisportomat/quiz/serializers.py index 8cb9246..54df094 100644 --- a/unisportomat/quiz/serializers.py +++ b/unisportomat/quiz/serializers.py @@ -99,6 +99,7 @@ class SingleSportSerializer(serializers.BaseSerializer): During this process, the Data is Validated on whether the Rating Value and Criterion ID are valid. If the Request is PATCHing or PUTting an existing Sport, not every field must be existant. So, the existance is explicitly checked. + TODO: Different Functions based on PUT or PATCH? """ sport_dictionary = {} diff --git a/unisportomat/quiz/views.py b/unisportomat/quiz/views.py index 6151431..ca418f7 100644 --- a/unisportomat/quiz/views.py +++ b/unisportomat/quiz/views.py @@ -135,7 +135,7 @@ class SmallSportListView(viewsets.ViewSet): """ PUT for api/admin/sport/<id>/ Creates a Sport if it doesn't exist, otherwise overwrites it. - TODO + TODO: Maybe Rework PUT if needed of Admin Frontend """ # Get Data from Serializer @@ -221,6 +221,7 @@ class IncompleteSportView(APIView): """ GET for api/admin/sport/incomplete/ Returns every incomplete Sport with its incomplete Ratings + TODO: Maybe Pagination """ incomplete_sport_list = [] @@ -249,6 +250,7 @@ class CriteriaView(APIView): Returns every Criterium and the Metadata of Number of Sports in which the Rating is >1 and the cumulated sum of Ratings >1 + TODO: Also Pagination """ data = [] -- GitLab