|
@@ -0,0 +1,20 @@
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
+from django.db import models
|
|
|
+from netfields import CidrAddressField, NetManager
|
|
|
+
|
|
|
+
|
|
|
+class IPPool(models.Model):
|
|
|
+ """Pool of IP addresses (either v4 or v6)."""
|
|
|
+ name = models.CharField(max_length=255, blank=False, null=False,
|
|
|
+ verbose_name='Name of the IP pool')
|
|
|
+ description = models.TextField(blank=True, null=False,
|
|
|
+ verbose_name='Description of the IP pool')
|
|
|
+ inet = CidrAddressField()
|
|
|
+ objects = NetManager()
|
|
|
+
|
|
|
+
|
|
|
+class IPSubnet(models.Model):
|
|
|
+ inet = CidrAddressField()
|
|
|
+ objects = NetManager()
|
|
|
+ ip_pool = models.ForeignKey(IPPool)
|
|
|
+ offer_subscription = models.ForeignKey('offers.OfferSubscription')
|