Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Backend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
swp-unisport
team-warumkeinrust
Backend
Commits
d2b289de
Commit
d2b289de
authored
3 years ago
by
borzechof99
Browse files
Options
Downloads
Patches
Plain Diff
Add Todos at various points
parent
4bd78e89
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
unisportomat/quiz/models.py
+2
-1
2 additions, 1 deletion
unisportomat/quiz/models.py
unisportomat/quiz/serializers.py
+1
-0
1 addition, 0 deletions
unisportomat/quiz/serializers.py
unisportomat/quiz/views.py
+3
-1
3 additions, 1 deletion
unisportomat/quiz/views.py
with
6 additions
and
2 deletions
unisportomat/quiz/models.py
+
2
−
1
View file @
d2b289de
...
@@ -6,7 +6,7 @@ from django.db import models
...
@@ -6,7 +6,7 @@ from django.db import models
def
validate_rating
(
value
):
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
):
if
not
((
10
>=
value
>=
1
)
or
value
==
-
1
):
...
@@ -133,6 +133,7 @@ class Criterion(models.Model):
...
@@ -133,6 +133,7 @@ class Criterion(models.Model):
def
get_active_sum
(
self
):
def
get_active_sum
(
self
):
"""
"""
Get Number of Sports with Rating larger than 1 and the cumulated sum of all ratings
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
num_active
=
0
...
...
This diff is collapsed.
Click to expand it.
unisportomat/quiz/serializers.py
+
1
−
0
View file @
d2b289de
...
@@ -99,6 +99,7 @@ class SingleSportSerializer(serializers.BaseSerializer):
...
@@ -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.
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.
If the Request is PATCHing or PUTting an existing Sport, not every field must be existant.
So, the existance is explicitly checked.
So, the existance is explicitly checked.
TODO: Different Functions based on PUT or PATCH?
"""
"""
sport_dictionary
=
{}
sport_dictionary
=
{}
...
...
This diff is collapsed.
Click to expand it.
unisportomat/quiz/views.py
+
3
−
1
View file @
d2b289de
...
@@ -135,7 +135,7 @@ class SmallSportListView(viewsets.ViewSet):
...
@@ -135,7 +135,7 @@ class SmallSportListView(viewsets.ViewSet):
"""
"""
PUT for api/admin/sport/<id>/
PUT for api/admin/sport/<id>/
Creates a Sport if it doesn
'
t exist, otherwise overwrites it.
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
# Get Data from Serializer
...
@@ -221,6 +221,7 @@ class IncompleteSportView(APIView):
...
@@ -221,6 +221,7 @@ class IncompleteSportView(APIView):
"""
"""
GET for api/admin/sport/incomplete/
GET for api/admin/sport/incomplete/
Returns every incomplete Sport with its incomplete Ratings
Returns every incomplete Sport with its incomplete Ratings
TODO: Maybe Pagination
"""
"""
incomplete_sport_list
=
[]
incomplete_sport_list
=
[]
...
@@ -249,6 +250,7 @@ class CriteriaView(APIView):
...
@@ -249,6 +250,7 @@ class CriteriaView(APIView):
Returns every Criterium and the Metadata of
Returns every Criterium and the Metadata of
Number of Sports in which the Rating is >1
Number of Sports in which the Rating is >1
and the cumulated sum of Ratings >1
and the cumulated sum of Ratings >1
TODO: Also Pagination
"""
"""
data
=
[]
data
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment