class Domain(models.Model): name = models.CharField(max_length=255, unique=True, db_index=True) type = models.CharField(max_length=6, db_index=True, choices=((x,x) for x in ('NATIVE', 'MASTER'))) notified_serial = models.PositiveIntegerField(null=True, blank=True, db_index=True) master = models.CharField(max_length=128, null=True,blank=True, db_index=True) last_check = models.PositiveIntegerField(null=True, blank=True, db_index=True) account = models.CharField(max_length=40, null=True, blank=True, db_index=True) class Meta: db_table = 'domains' ordering = ( 'name', 'type' ) def __unicode__(self): return self.name class Record(models.Model): domain = models.ForeignKey('Domain') name = models.CharField(max_length=255, db_index=True) type = models.CharField(max_length=6, db_index=True, choices=((x,x) for x in ('A', 'CNAME', 'NS', 'PTR', 'SOA'))) content = models.CharField(max_length=255, db_index=True) ttl = models.PositiveIntegerField(db_index=True) prio = models.PositiveIntegerField(null=True, blank=True, db_index=True) change_date = models.PositiveIntegerField(null=True, blank=True, db_index=True) class Meta: db_table = 'records' ordering = ( 'name', 'type' ) unique_together = ( 'name', 'type', 'content' ) def __unicode__(self): return self.name class Supermaster(models.Model): nameserver = models.CharField(max_length=255, db_index=True) account = models.CharField(max_length=40, null=True, blank=True, db_index=True) class Meta: db_table = 'supermasters' ordering = ( 'nameserver', 'account' ) unique_together = ( 'nameserver', 'account' ) def __unicode__(self): return self.nameserver