Merge branch 'Andr' into develop
This commit is contained in:
commit
18b41141e8
6 files changed
+221
-41
No files matched your search
+20
-4
@@ -42,8 +42,8 @@ class SetThanks(APIView):
|
||||
class GetThanks(APIView):
|
||||
def get(self, request):
|
||||
# Группировка кандидатов по имени и подсчет каждого
|
||||
count_thanks = ThanksVote.objects.values(
|
||||
'cand_name').annotate(total=Count('id'))
|
||||
count_thanks = ThanksVote.objects.values('voted_user',
|
||||
'cand_name').annotate(total=Count('id'))
|
||||
return Response(count_thanks)
|
||||
|
||||
|
||||
@@ -64,6 +64,22 @@ class SetBest(APIView):
|
||||
class GetBest(APIView):
|
||||
def get(self, request):
|
||||
# Группировка кандидатов по имени и подсчет каждого
|
||||
count_bests = BestVote.objects.values(
|
||||
'cand_name').annotate(total=Count('id'))
|
||||
count_bests = BestVote.objects.values('voted_user',
|
||||
'department_user', 'cand_name').annotate(total=Count('id'))
|
||||
return Response(count_bests)
|
||||
|
||||
|
||||
class GetNotVoteThn(APIView):
|
||||
def get(self, request):
|
||||
list_thn_users = ThanksVote.objects.values('voted_user')
|
||||
list_emp = DictEmployee.objects.filter(
|
||||
deleted=0).exclude(login__in=list_thn_users)
|
||||
return Response(GetEmpSerializer(list_emp, many=True).data)
|
||||
|
||||
|
||||
class GetNotVoteBst(APIView):
|
||||
def get(self, request):
|
||||
list_bst_users = BestVote.objects.values('voted_user')
|
||||
list_emp_bst = DictEmployee.objects.filter(
|
||||
deleted=0).exclude(login__in=list_bst_users)
|
||||
return Response(GetEmpSerializer(list_emp_bst, many=True).data)
|
||||
Reference in new issue
Block a user