1
0
mirror of https://github.com/daniviga/bite.git synced 2024-11-24 05:46:13 +01:00
bite/freedcs/telemetry/serializers.py

15 lines
382 B
Python
Raw Normal View History

2020-06-02 00:57:20 +02:00
from rest_framework import serializers
from api.models import Device
2020-06-02 00:57:20 +02:00
from telemetry.models import Telemetry
class TelemetrySerializer(serializers.ModelSerializer):
device = serializers.SlugRelatedField(
slug_field='serial',
queryset=Device.objects.all()
)
2020-06-02 00:57:20 +02:00
class Meta:
model = Telemetry
fields = ('time', 'device', 'clock', 'payload',)