from django.shortcuts import render
from django.shortcuts import get_object_or_404
from rest_framework import status, response, views

from foundations.models import Sensor
from sensor.serializers import SensorRetrieveSerializer


def sensor_retrieve_page(request, id):
    return render(request, "sensor/retrieve.html", {
        'id': id,
    })


class SensorRetrieveAPI(views.APIView):
    def get(self, request, id):
        sensor = get_object_or_404(Sensor, id=int(id))
        serializer = SensorRetrieveSerializer(sensor)
        return response.Response(
            status=status.HTTP_200_OK,
            data=serializer.data
        )

d73c77e327197260d1316f2ba06f33386c485b96
<mask token>


class SensorRetrieveAPI(views.APIView):
    <mask token>

<mask token>


class SensorRetrieveAPI(views.APIView):

    def get(self, request, id):
        sensor = get_object_or_404(Sensor, id=int(id))
        serializer = SensorRetrieveSerializer(sensor)
        return response.Response(status=status.HTTP_200_OK, data=serializer
            .data)

<mask token>


def sensor_retrieve_page(request, id):
    return render(request, 'sensor/retrieve.html', {'id': id})


class SensorRetrieveAPI(views.APIView):

    def get(self, request, id):
        sensor = get_object_or_404(Sensor, id=int(id))
        serializer = SensorRetrieveSerializer(sensor)
        return response.Response(status=status.HTTP_200_OK, data=serializer
            .data)

from django.shortcuts import render
from django.shortcuts import get_object_or_404
from rest_framework import status, response, views
from foundations.models import Sensor
from sensor.serializers import SensorRetrieveSerializer


def sensor_retrieve_page(request, id):
    return render(request, 'sensor/retrieve.html', {'id': id})


class SensorRetrieveAPI(views.APIView):

    def get(self, request, id):
        sensor = get_object_or_404(Sensor, id=int(id))
        serializer = SensorRetrieveSerializer(sensor)
        return response.Response(status=status.HTTP_200_OK, data=serializer
            .data)

from django.shortcuts import render
from django.shortcuts import get_object_or_404
from rest_framework import status, response, views

from foundations.models import Sensor
from sensor.serializers import SensorRetrieveSerializer


def sensor_retrieve_page(request, id):
    return render(request, "sensor/retrieve.html", {
        'id': id,
    })


class SensorRetrieveAPI(views.APIView):
    def get(self, request, id):
        sensor = get_object_or_404(Sensor, id=int(id))
        serializer = SensorRetrieveSerializer(sensor)
        return response.Response(
            status=status.HTTP_200_OK,
            data=serializer.data
        )
