Browse Source

Add text representation of IP resources

Baptiste Jonglez 11 years ago
parent
commit
1572e8a2d3
1 changed files with 6 additions and 0 deletions
  1. 6 0
      coin/resources/models.py

+ 6 - 0
coin/resources/models.py

@@ -12,6 +12,9 @@ class IPPool(models.Model):
     inet = CidrAddressField()
     objects = NetManager()
 
+    def __unicode__(self):
+        return self.name
+
 
 class IPSubnet(models.Model):
     inet = CidrAddressField()
@@ -19,3 +22,6 @@ class IPSubnet(models.Model):
     ip_pool = models.ForeignKey(IPPool)
     offer_subscription = models.ForeignKey('offers.OfferSubscription',
                                            related_name='ip_subnet')
+
+    def __unicode__(self):
+        return str(self.inet)