This commit is contained in:
iriska-gri committed 2023-10-16 09:28:31 +03:00
1 parent c3a896e7f6
commit 506e657cbe
8 files changed
+62 -25

No files matched your search

+1
View File
@@ -4,4 +4,5 @@ from .views import *
urlpatterns = [
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
]
+11 -1
View File
@@ -2,8 +2,9 @@ from rest_framework.response import Response
import datetime
from .serializers import *
from .models import *
import pandas as pd
from rest_framework.views import APIView
from userauth.models import *
class GeneralVacationAPIView(APIView):
def get(self, request):
@@ -21,3 +22,12 @@ class GeneralVacationAPIView(APIView):
many=True # Указываем, что на вход подаётся именно набор записей
)
return Response({"Отпуск": serializer_for_basecrit.data, "План-график": serializer_for_plan.data})
class DailyRoundUpAPIView(APIView):
def get(self, request):
user = DictEmployee.objects.using('user_directory').values('login', 'fio')
df = pd.DataFrame.from_records(user)
print(df)
return Response('user')