mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
fix mac-ip-dns
This commit is contained in:
parent
4e830d5619
commit
ef0042b0d6
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue