Второй этап
This commit is contained in:
1 parent
b02fa66f41
commit
a0edc64f1c
25 files changed
+97
-56
No files matched your search
@@ -1,3 +1,17 @@
|
||||
from django.shortcuts import render
|
||||
from rest_framework.response import Response
|
||||
import datetime
|
||||
from .serializers import *
|
||||
from .models import *
|
||||
|
||||
# Create your views here.
|
||||
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