| 12345678910111213 |
- from django.shortcuts import render
- from rest_framework.views import APIView
- from rest_framework.views import Response
- from apps.DeviceCount.models import CbdPhoto
- from apps.DeviceCount.serializers import CbdPhotoSerializers
- class CbdPhotoCount(APIView):
- def post(self, request):
- query = CbdPhoto.objects.all().order_by("-id")
- serializer = CbdPhotoSerializers(query, many=True)
- return Response({"data": serializer.data}, status=200)
|