PowerDNS models

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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

More like this

  1. Models with database views by diverman 4 years, 10 months ago
  2. Many 2 Many Admin Ordering with Mysql by visik7 8 months, 1 week ago
  3. MySQL "Text" Type Model Field by blackbrrr 5 years, 10 months ago
  4. Locking tables by miohtama 5 years, 9 months ago
  5. TinyIntegerField by Lacour 2 years, 8 months ago

Comments

(Forgotten your password?)