bcommon models are all set. servers, keys, zones

This commit is contained in:
Jeffrey Forman 2011-04-13 19:24:25 -04:00
parent 7314c6daf8
commit c10569504b
2 changed files with 7 additions and 7 deletions

View File

@ -1,23 +1,24 @@
from django.db import models from django.db import models
import dns.query
import dns.zone
class BindServer(models.Model): class BindServer(models.Model):
name = models.CharField(max_length=50)
hostname = models.CharField(max_length=100) hostname = models.CharField(max_length=100)
def __unicode__(self): def __unicode__(self):
return self.name return self.hostname
class Key(models.Model): class Key(models.Model):
name = models.CharField(max_length=50) name = models.CharField(max_length=50)
data = models.TextField() data = models.CharField(max_length=24)
def __unicode__(self): def __unicode__(self):
return self.name return self.name
class Zone(models.Model): class Zone(models.Model):
server = models.ForeignKey('BindServer') server = models.ForeignKey('BindServer')
key = models.ForeignKey('Key') zone_name = models.CharField(max_length=50)
name = models.CharField(max_length=50)
def __unicode__(self): def __unicode__(self):
return "%s: %s" % (self.server, self.name) return self.zone_name

View File

@ -1 +0,0 @@
# Create your views here.