Revision ff863a80 snf-cyclades-app/synnefo/db/models.py

b/snf-cyclades-app/synnefo/db/models.py
756 756
                    ip_pool.save()
757 757

  
758 758

  
759
class IPAddressLog(models.Model):
760
    address = models.CharField("IP Address", max_length=64, null=False,
761
                               db_index=True)
762
    server_id = models.IntegerField("Server", null=False)
763
    network_id = models.IntegerField("Network", null=False)
764
    allocated_at = models.DateTimeField("Datetime IP allocated to server",
765
                                        auto_now_add=True)
766
    released_at = models.DateTimeField("Datetime IP released from server",
767
                                       null=True)
768
    active = models.BooleanField("Whether IP still allocated to server",
769
                                 default=True)
770

  
771
    def __unicode__(self):
772
        return u"<Address: %s, Server: %s, Network: %s, Allocated at: %s>"\
773
               % (self.address, self.network_id, self.server_id,
774
                  self.allocated_at)
775

  
776

  
759 777
class NetworkInterface(models.Model):
760 778
    FIREWALL_PROFILES = (
761 779
        ('ENABLED', 'Enabled'),

Also available in: Unified diff