mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-30 08:32:26 +00:00
Export complet du prefix v6
This commit is contained in:
parent
cf3edceff5
commit
63748168f2
2 changed files with 6 additions and 1 deletions
|
@ -673,7 +673,7 @@ class SubnetPortsOpenSerializer(serializers.ModelSerializer):
|
|||
|
||||
class Meta:
|
||||
model = machines.IpType
|
||||
fields = ('type', 'domaine_ip_start', 'domaine_ip_stop', 'prefix_v6', 'ouverture_ports')
|
||||
fields = ('type', 'domaine_ip_start', 'domaine_ip_stop', 'complete_prefixv6', 'ouverture_ports')
|
||||
|
||||
# DHCP
|
||||
|
||||
|
|
|
@ -336,6 +336,11 @@ class IpType(RevMixin, AclMixin, models.Model):
|
|||
else:
|
||||
return None
|
||||
|
||||
@cached_property
|
||||
def complete_prefixv6(self):
|
||||
"""Return the complete prefix v6 as cidr"""
|
||||
return str(self.prefix_v6) + "/" + str(self.prefix_v6_length)
|
||||
|
||||
def ip_objects(self):
|
||||
""" Renvoie tous les objets ipv4 relié à ce type"""
|
||||
return IpList.objects.filter(ip_type=self)
|
||||
|
|
Loading…
Reference in a new issue