|
|
@ -6,6 +6,7 @@ from rest_framework.response import Response
|
|
|
|
from rest_framework import status
|
|
|
|
from rest_framework import status
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from .serializers import *
|
|
|
|
from .serializers import *
|
|
|
|
|
|
|
|
from rest_framework.pagination import PageNumberPagination
|
|
|
|
|
|
|
|
|
|
|
|
class UserProfilesAPIView(APIView):
|
|
|
|
class UserProfilesAPIView(APIView):
|
|
|
|
def get(self, request):
|
|
|
|
def get(self, request):
|
|
|
@ -139,4 +140,21 @@ class DailyReportAPIView(APIView):
|
|
|
|
dailyreport = DailyReport.objects.all()
|
|
|
|
dailyreport = DailyReport.objects.all()
|
|
|
|
data = DailyReportSerializer(dailyreport, many=True).data
|
|
|
|
data = DailyReportSerializer(dailyreport, many=True).data
|
|
|
|
|
|
|
|
|
|
|
|
return Response(data, status=status.HTTP_200_OK)
|
|
|
|
return Response(data, status=status.HTTP_200_OK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class StatusAPIView(APIView):
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
|
|
|
|
statuses = Status.objects.all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Initialize paginator
|
|
|
|
|
|
|
|
paginator = PageNumberPagination()
|
|
|
|
|
|
|
|
paginator.page_size = 50 # Set default page size
|
|
|
|
|
|
|
|
result_page = paginator.paginate_queryset(statuses, request)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Serialize paginated data
|
|
|
|
|
|
|
|
serializer = StatusSerializer(result_page, many=True)
|
|
|
|
|
|
|
|
return paginator.get_paginated_response(serializer.data)
|