mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Complete_name d'un switch
This commit is contained in:
parent
d1131d732f
commit
a5726603e3
2 changed files with 7 additions and 1 deletions
|
@ -723,7 +723,7 @@ class SwitchPortSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = topologie.Switch
|
model = topologie.Switch
|
||||||
fields = ('short_name', 'model', 'switchbay', 'ports', 'ipv4', 'ipv6', 'subnet', 'subnet6')
|
fields = ('short_name', 'complete_name', 'model', 'switchbay', 'ports', 'ipv4', 'ipv6', 'subnet', 'subnet6')
|
||||||
|
|
||||||
# DHCP
|
# DHCP
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,12 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
|
||||||
de cette machine"""
|
de cette machine"""
|
||||||
return str(self.interface_set.first().domain.name)
|
return str(self.interface_set.first().domain.name)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def complete_name(self):
|
||||||
|
"""Par defaut, renvoie le nom de la première interface
|
||||||
|
de cette machine"""
|
||||||
|
return str(self.interface_set.first())
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def all_short_names(self):
|
def all_short_names(self):
|
||||||
"""Renvoie de manière unique, le nom des interfaces de cette
|
"""Renvoie de manière unique, le nom des interfaces de cette
|
||||||
|
|
Loading…
Reference in a new issue