Browse Source

Add DS records to reverse zone

master^2
Sebastian Lohff 4 years ago
parent
commit
39b65ceba0
  1. 2
      domains/forms.py
  2. 14
      domains/models.py

2
domains/forms.py

@ -210,7 +210,7 @@ class NameserverForm(MntFormMixin, WhoisObjectFormMixin, forms.ModelForm): @@ -210,7 +210,7 @@ class NameserverForm(MntFormMixin, WhoisObjectFormMixin, forms.ModelForm):
return cleaned_data
class ReverseZoneForm(forms.ModelForm):
class ReverseZoneForm(DSRecordMixin, forms.ModelForm):
prefix = forms.CharField(validators=[IP46CIDRValidator])
class Meta:

14
domains/models.py

@ -13,6 +13,13 @@ import ipaddress @@ -13,6 +13,13 @@ import ipaddress
# allow owners of a subnet to create reverse dns record?
class DSRecordModelMixin(models.Model):
class Meta:
abstract = True
ds_records = models.TextField(blank=True, verbose_name='DS Records',
help_text='DS Records in the format of [id] [crypto-algo] [hash-algo] [hash]')
class Nameserver(MntdObject):
handleSuffix = "NS"
# dns name
@ -42,7 +49,7 @@ class Nameserver(MntdObject): @@ -42,7 +49,7 @@ class Nameserver(MntdObject):
return []
class Domain(MntdObject):
class Domain(DSRecordModelMixin, MntdObject):
handle = None
handleSuffix = "DOM"
name = models.CharField(max_length=67, unique=True, db_index=True)
@ -50,9 +57,6 @@ class Domain(MntdObject): @@ -50,9 +57,6 @@ class Domain(MntdObject):
nameservers = models.ManyToManyField(Nameserver, blank=True)
admin_c = models.ManyToManyField(Contact)
ds_records = models.TextField(blank=True, verbose_name='DS Records',
help_text='DS Records in the format of [id] [crypto-algo] [hash-algo] [hash]')
def getPK(self):
return self.name
@ -85,7 +89,7 @@ class Domain(MntdObject): @@ -85,7 +89,7 @@ class Domain(MntdObject):
return name.lower()
class ReverseZone(WhoisObject):
class ReverseZone(DSRecordModelMixin, WhoisObject):
handle = None
parentNet = models.ForeignKey(InetNum)

Loading…
Cancel
Save