1
0
mirror of https://github.com/daniviga/bite.git synced 2024-11-23 13:26:14 +01:00
bite/freedcs/telemetry/serializers.py
Daniele Viganò 4cebe6a8f5
Manage serial numbers on POST (#7)
* Update subscription if exists

* POST with serial #
2020-06-03 18:57:53 +02:00

15 lines
382 B
Python

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