From 133d83f282b933ae78edc5c4a8209b14a9ac59bd Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 26 Dec 2016 18:00:43 +0100 Subject: [PATCH] fix mac-ip-dns --- machines/serializers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/machines/serializers.py b/machines/serializers.py index dc2e7629..aff398a3 100644 --- a/machines/serializers.py +++ b/machines/serializers.py @@ -19,13 +19,17 @@ class InterfaceSerializer(serializers.ModelSerializer): mac_address = serializers.SerializerMethodField('get_macaddress') dns = serializers.SerializerMethodField('get_dns') domain = serializers.SerializerMethodField('get_dns') + extension = serializers.SerializerMethodField('get_extension') class Meta: model = Interface - fields = ('ipv4', 'mac_address', 'domain') + fields = ('ipv4', 'mac_address', 'domain', 'extension') def get_dns(self, obj): - return obj + return obj.domain.name + + def get_extension(self, obj): + return obj.domain.extension.name def get_macaddress(self, obj): return str(obj.mac_address)