mirror of
https://github.com/daniviga/bite.git
synced 2024-11-23 21:36:14 +01:00
15 lines
382 B
Python
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',)
|