mirror of
https://github.com/daniviga/bite.git
synced 2024-11-27 07:16:12 +01:00
23 lines
781 B
Python
23 lines
781 B
Python
from rest_framework.viewsets import ModelViewSet
|
|
|
|
from telemetry.models import Telemetry
|
|
from telemetry.serializers import TelemetrySerializer
|
|
|
|
|
|
class Telemetry(ModelViewSet):
|
|
queryset = Telemetry.objects.all()
|
|
serializer_class = TelemetrySerializer
|
|
|
|
# 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)
|