Adds IPv6 domain address support.
Depends on py3 branch
This commit is contained in:
1 parent
b782699311
commit
ada13fde90
4 files changed
+886
-850
No files matched your search
+1
-1
@@ -115,7 +115,7 @@ class DomainARecordInline(admin.TabularInline):
|
||||
|
||||
class DomainAdmin(admin.ModelAdmin):
|
||||
inlines = [DomainSrvRecordInline, DomainTxtRecordInline, DomainARecordInline, DomainCnameRecordInline]
|
||||
list_display = ['domain_name', 'domain_soa', 'domain_admin', 'num_records', 'domain_ipaddr']
|
||||
list_display = ['domain_name', 'domain_soa', 'domain_admin', 'num_records', 'domain_ipaddr', 'domain_ip6addr']
|
||||
search_fields = ['domain_name']
|
||||
|
||||
|
||||
|
||||
+850
-849
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import re
|
||||
import django.core.validators
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mdb', '0008_auto_20151004_1258'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='domain',
|
||||
name='domain_ip6addr',
|
||||
field=models.GenericIPAddressField(null=True, protocol='IPv6', blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='host',
|
||||
name='hostname',
|
||||
field=models.CharField(max_length=64, validators=[django.core.validators.RegexValidator(regex=re.compile('^(?!-)[-a-z0-9]+(?<!-)$', 2), message='Enter a valid hostname', code='invalid')]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='interface',
|
||||
name='macaddr',
|
||||
field=models.CharField(max_length=17, validators=[django.core.validators.RegexValidator(regex=re.compile('^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$', 2), message='Enter a valid MAC address', code='invalid')]),
|
||||
),
|
||||
]
|
||||
@@ -40,6 +40,7 @@ class Domain(models.Model):
|
||||
domain_minimum_ttl = models.IntegerField(default=86400)
|
||||
domain_admin = models.EmailField()
|
||||
domain_ipaddr = models.GenericIPAddressField(protocol='IPv4')
|
||||
domain_ip6addr = models.GenericIPAddressField(protocol='IPv6', blank=True, null=True)
|
||||
domain_filename = models.CharField(max_length=256)
|
||||
created_date = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
@@ -92,6 +93,9 @@ class Domain(models.Model):
|
||||
if self.domain_ipaddr is not None:
|
||||
content += "@\tIN\tA\t%s\n" % self.domain_ipaddr
|
||||
|
||||
if self.domain_ip6addr is not None:
|
||||
content += "@\tIN\tAAAA\t%s\n" % self.domain_ip6addr
|
||||
|
||||
content += "; SRV records\n"
|
||||
|
||||
for srv in self.domainsrvrecord_set.all():
|
||||
|
||||
Reference in new issue
Block a user