From 6c97cee9641d70edbeda15e30c9bec85ba5c0cb5 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Sat, 1 Apr 2017 16:42:20 -0400 Subject: [PATCH] nest the json --- stagestatus/apps/machines/api/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stagestatus/apps/machines/api/serializers.py b/stagestatus/apps/machines/api/serializers.py index d66d1ea..5a96677 100644 --- a/stagestatus/apps/machines/api/serializers.py +++ b/stagestatus/apps/machines/api/serializers.py @@ -8,7 +8,6 @@ class MachineReservationSerializer(serializers.ModelSerializer): class Meta: model = MachineReservation fields = ( - 'machine', 'user', 'notes', ) @@ -19,7 +18,6 @@ class MachineStatusSerializer(serializers.ModelSerializer): class Meta: model = MachineStatus fields = ( - 'machine', 'git_branch', 'git_version', 'last_db_refresh', @@ -29,6 +27,8 @@ class MachineStatusSerializer(serializers.ModelSerializer): class MachineSerializer(serializers.ModelSerializer): is_reserved = serializers.SerializerMethodField() + status = MachineStatusSerializer() + reservation = MachineReservationSerializer() def get_is_reserved(self, machine): return machine.is_reserved()