From 89f91add15ecd08a837f737d6d535457f8d52be5 Mon Sep 17 00:00:00 2001 From: histausse Date: Tue, 1 Sep 2020 14:01:19 +0200 Subject: [PATCH] =?UTF-8?q?#=20Ceci=20est=20la=20combinaison=20de=204=20co?= =?UTF-8?q?mmits.=20#=20Ceci=20est=20le=20premier=20message=20de=20validat?= =?UTF-8?q?ion=C2=A0:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add building to the room serialiser # Ceci est le message de validation numéro 2 : Add dormitory to the building serialiser # Ceci est le message de validation numéro 3 : Add dormitory to the building serialiser # Ceci est le message de validation numéro 4 : Add dormitory to the building serialiser --- topologie/api/serializers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/topologie/api/serializers.py b/topologie/api/serializers.py index 18785ebb..2e3a6c0f 100644 --- a/topologie/api/serializers.py +++ b/topologie/api/serializers.py @@ -115,8 +115,14 @@ class BuildingSerializer(NamespacedHMSerializer): class Meta: model = topologie.Building - fields = ("name", "api_url") + fields = ("name", "dormitory", "api_url") +class DormitorySerializer(NamespaceHMSerializer): + """Serialize `topologie.models.Dormitory` objects + """ + class Meta: + model = topologie.Dormitory + fields = ("name", "api_url") class SwitchPortSerializer(NamespacedHMSerializer): """Serialize `topologie.models.Port` objects @@ -176,7 +182,7 @@ class RoomSerializer(NamespacedHMSerializer): class Meta: model = topologie.Room - fields = ("name", "details", "api_url") + fields = ("name", "building", "details", "api_url") class PortProfileSerializer(NamespacedHMSerializer):