Skip to content

Commit

Permalink
feat: made pie chart event wise
Browse files Browse the repository at this point in the history
  • Loading branch information
rb-25 committed Apr 17, 2024
1 parent 87de76f commit 67ac173
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gibspons/spons_app/views/leaderboard_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rest_framework.permissions import IsAuthenticated
from rest_framework import status
from users.models import User
from spons_app.models import Company
from spons_app.models import Company,Sponsorship
from spons_app.serializers import LeaderboardSerializer


Expand All @@ -23,8 +23,8 @@ class StatusPieChartView(APIView):
permission_classes=[IsAuthenticated]
authentication_classes=[JWTAuthentication]
def get(self,request):
organisation_id = request.query_params.get('org')
data = Company.objects.filter(organisation=organisation_id).values('status').annotate(count=Count('id'))
event = request.query_params.get('event')
data = Sponsorship.objects.filter(event_id=event).values('status').annotate(count=Count('id'))

# Prepare data for response
response_data = {}
Expand Down

0 comments on commit 67ac173

Please sign in to comment.