Browse Source

Fix verbose names of IP pools and subnets

Baptiste Jonglez 11 years ago
parent
commit
4cb9aa2105
1 changed files with 11 additions and 7 deletions
  1. 11 7
      coin/resources/models.py

+ 11 - 7
coin/resources/models.py

@@ -19,11 +19,13 @@ def validate_subnet(cidr):
 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')
+                            help_text='Name of the IP pool')
     default_subnetsize = models.PositiveSmallIntegerField(blank=False,
-                                                          verbose_name='Default subnet size to allocate to subscribers in this pool',
+                                                          verbose_name='default subnet size',
+                                                          help_text='Default subnet size to allocate to subscribers in this pool',
                                                           validators=[MaxValueValidator(64)])
-    inet = CidrAddressField(validators=[validate_subnet])
+    inet = CidrAddressField(validators=[validate_subnet],
+                            help_text="Address space to use")
     objects = NetManager()
 
     def clean(self):
@@ -51,15 +53,17 @@ class IPSubnet(models.Model):
     # Actually, a better idea would be to build a custom relation and update
     # LDAP in the relation itself.
     inet = CidrAddressField(blank=True, validators=[validate_subnet],
-                            verbose_name="Leave empty for automatic allocation")
+                            verbose_name="subnet",
+                            help_text="Leave empty for automatic allocation")
     objects = NetManager()
-    ip_pool = models.ForeignKey(IPPool)
+    ip_pool = models.ForeignKey(IPPool, verbose_name="IP pool")
     offer_subscription = models.ForeignKey('offers.OfferSubscription',
-                                           related_name='ip_subnet')
+                                           related_name='ip_subnet',
+                                           verbose_name="subscription")
     delegate_reverse_dns = models.BooleanField(default=False)
     name_server = models.ManyToManyField('reverse_dns.NameServer',
                                          blank=True,
-                                         verbose_name="nameserver to use for the delegation of reverse DNS")
+                                         help_text="Nameserver to use for the delegation of reverse DNS")
 
     def allocate(self):
         """Automatically allocate a free subnet"""