fix serializer response

This commit is contained in:
d0c 2023-02-17 14:50:26 +01:00
parent 2cb87ebb90
commit f6a4745dfd

View file

@ -1,6 +1,6 @@
from rest_framework import serializers
from suitablephones.models import Bluetooth, Camera, Device
from suitablephones.models import Bluetooth, Camera, Device, Screen
class CameraSerializer(serializers.ModelSerializer):
@ -22,6 +22,7 @@ class ScreenSerializer(serializers.ModelSerializer):
class DeviceSerializer(serializers.ModelSerializer):
bluetooth = BluetoothSerializer(many=False, read_only=True)
cameras = CameraSerializer(many=True, read_only=True)
screen = ScreenSerializer(many=True, read_only=True)
class Meta:
model = Device