2020-06-02 00:57:20 +02:00
|
|
|
from rest_framework import serializers
|
|
|
|
from api.serializers import DeviceSerializer
|
|
|
|
from telemetry.models import Telemetry
|
|
|
|
|
|
|
|
|
|
|
|
class TelemetrySerializer(serializers.ModelSerializer):
|
|
|
|
# device = DeviceSerializer(read_only=True)
|
|
|
|
|
|
|
|
def validate(self, data):
|
|
|
|
return data
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Telemetry
|
2020-06-03 18:53:33 +02:00
|
|
|
fields = ('time', 'device', 'clock', 'payload',)
|
2020-06-02 00:57:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
# class WhiteListSerializer(serializers.ModelSerializer):
|
|
|
|
# class Meta:
|
|
|
|
# model = Device
|
|
|
|
# fields = ('serial', 'creation_time', 'updated_time',)
|