Skip to content

Commit a89aa5e

Browse files
committed
feat(API/match/group): add honor_points and total_time_seconds field. Rename total_points to regular_points
1 parent 0e734bb commit a89aa5e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

server/api/match/serializers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ class GroupSerializer(serializers.Serializer):
2020
group = serializers.IntegerField()
2121
team = serializers.IntegerField()
2222
team_name = serializers.CharField(max_length=64)
23-
total_points = serializers.IntegerField()
23+
regular_points = serializers.IntegerField()
24+
honor_points = serializers.IntegerField()
25+
total_time_seconds = serializers.IntegerField()

server/api/match/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ def get_queryset(self):
2424
result = MatchResult.objects.values("team", "team__team_name", "match__group_id")\
2525
.annotate(team_name=F("team__team_name"))\
2626
.annotate(group=F("match__group_id"))\
27-
.annotate(total_points=Sum('point'))
27+
.annotate(honor_points=Sum('honor_point'))\
28+
.annotate(regular_points=Sum('point'))\
29+
.annotate(total_time_seconds=Sum('completed_time_second'))
2830
return result

0 commit comments

Comments
 (0)