Commit ef0042b0 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

fix mac-ip-dns

parent 4e830d56
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment