From 5502be73bb31377735f5e3f3cd01f666a4ab5ff0 Mon Sep 17 00:00:00 2001 From: d0c Date: Mon, 20 Feb 2023 15:59:44 +0100 Subject: [PATCH] serializer short --- suitablephones/serializers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/suitablephones/serializers.py b/suitablephones/serializers.py index 8007ef7..dbc2112 100644 --- a/suitablephones/serializers.py +++ b/suitablephones/serializers.py @@ -26,4 +26,9 @@ class DeviceSerializer(serializers.ModelSerializer): class Meta: model = Device - exclude = ["id"] \ No newline at end of file + exclude = ["id"] + +class DeviceSerializerShort(DeviceSerializer): + class Meta: + model = Device + include = ["codename", "vendor", "name", "release", "maintainers", "cameras", "battery", "screen"] \ No newline at end of file