Commit 63748168 authored by Gabriel Detraz's avatar Gabriel Detraz

Export complet du prefix v6

parent cf3edcef
......@@ -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)
......
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