1
0
mirror of https://github.com/daniviga/bite.git synced 2024-11-30 08:36:14 +01:00
bite/freedcs/api/views.py

23 lines
760 B
Python

from rest_framework.viewsets import ModelViewSet
from api.models import Device
from api.serializers import DeviceSerializer
class APISubscribe(ModelViewSet):
queryset = Device.objects.all()
serializer_class = DeviceSerializer
# def post(self, request):
# serializer = DeviceSerializer(data=request.data)
# if serializer.is_valid():
# serializer.save()
# return Response(serializer.data, status=status.HTTP_201_CREATED)
# return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
# def get(self, request):
# devices = Device.objects.all()
# import pdb; pdb.set_trace()
# serializer = DeviceSerializer(devices)
# return Response(serializer.serial)