Попытка 3
This commit is contained in:
1 parent
7cba2e0366
commit
1b3ac28ddf
15 files changed
No files matched your search
@@ -0,0 +1,17 @@
|
||||
from rest_framework.response import Response
|
||||
import datetime
|
||||
from .serializers import *
|
||||
from .models import *
|
||||
|
||||
from rest_framework.views import APIView
|
||||
|
||||
class GeneralVacationAPIView(APIView):
|
||||
def get(self, request):
|
||||
general = GeneralVacation.objects.all()
|
||||
|
||||
# Сериализуем извлечённый набор записей
|
||||
serializer_for_basecrit = GeneralVacationSerializer(
|
||||
instance=general, # Передаём набор записей
|
||||
many=True # Указываем, что на вход подаётся именно набор записей
|
||||
)
|
||||
return Response({"Отпуск": serializer_for_basecrit.data})
|
||||
Reference in new issue
Block a user