netbox-plugin-dns 1.1.2__py3-none-any.whl → 1.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netbox-plugin-dns might be problematic. Click here for more details.
- netbox_dns/__init__.py +14 -6
- netbox_dns/api/nested_serializers.py +3 -2
- netbox_dns/api/serializers_/nameserver.py +2 -1
- netbox_dns/api/serializers_/record.py +5 -4
- netbox_dns/api/serializers_/record_template.py +2 -1
- netbox_dns/api/serializers_/view.py +2 -1
- netbox_dns/api/serializers_/zone.py +12 -11
- netbox_dns/api/serializers_/zone_template.py +8 -7
- netbox_dns/api/views.py +9 -4
- netbox_dns/choices/record.py +4 -2
- netbox_dns/choices/zone.py +8 -4
- netbox_dns/fields/address.py +5 -22
- netbox_dns/fields/network.py +2 -1
- netbox_dns/fields/rfc2317.py +7 -3
- netbox_dns/filtersets/nameserver.py +3 -2
- netbox_dns/filtersets/record.py +14 -9
- netbox_dns/filtersets/record_template.py +3 -2
- netbox_dns/filtersets/view.py +3 -2
- netbox_dns/filtersets/zone.py +24 -22
- netbox_dns/filtersets/zone_template.py +15 -14
- netbox_dns/forms/nameserver.py +41 -17
- netbox_dns/forms/record.py +61 -32
- netbox_dns/forms/record_template.py +49 -28
- netbox_dns/forms/registrar.py +21 -17
- netbox_dns/forms/registration_contact.py +37 -25
- netbox_dns/forms/view.py +49 -27
- netbox_dns/forms/zone.py +173 -120
- netbox_dns/forms/zone_template.py +53 -43
- netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
- netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
- netbox_dns/management/commands/rebuild_dnssync.py +14 -1
- netbox_dns/models/nameserver.py +6 -2
- netbox_dns/models/record.py +74 -40
- netbox_dns/models/record_template.py +17 -9
- netbox_dns/models/registrar.py +11 -7
- netbox_dns/models/registration_contact.py +23 -11
- netbox_dns/models/view.py +15 -6
- netbox_dns/models/zone.py +83 -50
- netbox_dns/models/zone_template.py +12 -10
- netbox_dns/navigation.py +30 -28
- netbox_dns/signals/ipam_dnssync.py +21 -14
- netbox_dns/tables/ipam_dnssync.py +2 -1
- netbox_dns/tables/nameserver.py +2 -0
- netbox_dns/tables/record.py +21 -11
- netbox_dns/tables/record_template.py +12 -5
- netbox_dns/tables/registrar.py +2 -0
- netbox_dns/tables/registration_contact.py +2 -0
- netbox_dns/tables/view.py +3 -1
- netbox_dns/tables/zone.py +15 -2
- netbox_dns/tables/zone_template.py +7 -0
- netbox_dns/templates/netbox_dns/nameserver.html +6 -5
- netbox_dns/templates/netbox_dns/record/managed.html +2 -1
- netbox_dns/templates/netbox_dns/record/related.html +26 -14
- netbox_dns/templates/netbox_dns/record.html +39 -20
- netbox_dns/templates/netbox_dns/recordtemplate.html +27 -15
- netbox_dns/templates/netbox_dns/registrar.html +11 -10
- netbox_dns/templates/netbox_dns/registrationcontact.html +16 -15
- netbox_dns/templates/netbox_dns/view/button.html +2 -1
- netbox_dns/templates/netbox_dns/view/prefix.html +7 -4
- netbox_dns/templates/netbox_dns/view/related.html +26 -10
- netbox_dns/templates/netbox_dns/view.html +11 -14
- netbox_dns/templates/netbox_dns/zone/base.html +2 -1
- netbox_dns/templates/netbox_dns/zone/child.html +3 -2
- netbox_dns/templates/netbox_dns/zone/record.html +3 -2
- netbox_dns/templates/netbox_dns/zone/registration.html +8 -7
- netbox_dns/templates/netbox_dns/zone.html +28 -30
- netbox_dns/templates/netbox_dns/zonetemplate.html +27 -17
- netbox_dns/utilities/ipam_dnssync.py +15 -4
- netbox_dns/validators/dns_name.py +11 -4
- netbox_dns/validators/dns_value.py +55 -9
- netbox_dns/validators/rfc2317.py +6 -3
- netbox_dns/views/nameserver.py +4 -2
- netbox_dns/views/record_template.py +4 -3
- netbox_dns/views/registrar.py +3 -1
- netbox_dns/views/registration_contact.py +2 -1
- netbox_dns/views/view.py +2 -1
- netbox_dns/views/zone.py +6 -4
- netbox_dns/views/zone_template.py +8 -7
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/METADATA +2 -2
- netbox_plugin_dns-1.1.4.dist-info/RECORD +150 -0
- netbox_plugin_dns-1.1.2.dist-info/RECORD +0 -148
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/WHEEL +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/top_level.txt +0 -0
netbox_dns/forms/zone.py
CHANGED
|
@@ -3,6 +3,8 @@ from django.db import transaction
|
|
|
3
3
|
from django.conf import settings
|
|
4
4
|
from django.core.validators import MinValueValidator, MaxValueValidator
|
|
5
5
|
from django.core.exceptions import ValidationError
|
|
6
|
+
from django.utils.translation import gettext_lazy as _
|
|
7
|
+
from django.utils.translation import pgettext_lazy as _p
|
|
6
8
|
|
|
7
9
|
from netbox.forms import (
|
|
8
10
|
NetBoxModelBulkEditForm,
|
|
@@ -22,7 +24,7 @@ from utilities.forms.fields import (
|
|
|
22
24
|
from utilities.forms.widgets import BulkEditNullBooleanSelect
|
|
23
25
|
from utilities.forms.rendering import FieldSet
|
|
24
26
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
|
25
|
-
from tenancy.models import Tenant
|
|
27
|
+
from tenancy.models import Tenant, TenantGroup
|
|
26
28
|
from tenancy.forms import TenancyForm, TenancyFilterForm
|
|
27
29
|
|
|
28
30
|
from netbox_dns.models import (
|
|
@@ -125,77 +127,93 @@ class ZoneTemplateUpdateMixin:
|
|
|
125
127
|
|
|
126
128
|
|
|
127
129
|
class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
130
|
+
name = forms.CharField(
|
|
131
|
+
required=True,
|
|
132
|
+
label=_("Name"),
|
|
133
|
+
)
|
|
134
|
+
template = DynamicModelChoiceField(
|
|
135
|
+
queryset=ZoneTemplate.objects.all(),
|
|
136
|
+
required=False,
|
|
137
|
+
label=_("Template"),
|
|
138
|
+
)
|
|
139
|
+
status = forms.ChoiceField(
|
|
140
|
+
choices=ZoneStatusChoices,
|
|
141
|
+
required=False,
|
|
142
|
+
label=_("Status"),
|
|
143
|
+
)
|
|
128
144
|
nameservers = DynamicModelMultipleChoiceField(
|
|
129
145
|
queryset=NameServer.objects.all(),
|
|
130
146
|
required=False,
|
|
147
|
+
label=_("Nameservers"),
|
|
131
148
|
)
|
|
132
149
|
default_ttl = forms.IntegerField(
|
|
133
150
|
required=False,
|
|
134
|
-
|
|
135
|
-
help_text="Default TTL for new records in this zone",
|
|
151
|
+
help_text=_("Default TTL for new records in this zone"),
|
|
136
152
|
validators=[MinValueValidator(1)],
|
|
153
|
+
label=_("Default TTL"),
|
|
154
|
+
)
|
|
155
|
+
description = forms.CharField(
|
|
156
|
+
required=False,
|
|
157
|
+
label=_("Description"),
|
|
137
158
|
)
|
|
138
159
|
soa_ttl = forms.IntegerField(
|
|
139
160
|
required=True,
|
|
140
|
-
|
|
141
|
-
help_text="TTL for the SOA record of the zone",
|
|
161
|
+
help_text=_("TTL for the SOA record of the zone"),
|
|
142
162
|
validators=[MinValueValidator(1)],
|
|
163
|
+
label=_("SOA TTL"),
|
|
143
164
|
)
|
|
144
165
|
soa_rname = forms.CharField(
|
|
145
166
|
required=True,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
149
|
-
soa_serial_auto = forms.BooleanField(
|
|
150
|
-
required=False,
|
|
151
|
-
label="Generate SOA Serial",
|
|
152
|
-
help_text="Automatically generate the SOA Serial",
|
|
153
|
-
)
|
|
154
|
-
soa_serial = forms.IntegerField(
|
|
155
|
-
required=False,
|
|
156
|
-
label="SOA Serial",
|
|
157
|
-
help_text="Serial number of the current zone data version",
|
|
158
|
-
validators=[MinValueValidator(1)],
|
|
167
|
+
help_text=_("Mailbox of the zone's administrator"),
|
|
168
|
+
label=_("SOA RName"),
|
|
159
169
|
)
|
|
160
170
|
soa_refresh = forms.IntegerField(
|
|
161
171
|
required=True,
|
|
162
|
-
|
|
163
|
-
help_text="Refresh interval for secondary name servers",
|
|
172
|
+
help_text=_("Refresh interval for secondary nameservers"),
|
|
164
173
|
validators=[MinValueValidator(1)],
|
|
174
|
+
label=_("SOA Refresh"),
|
|
165
175
|
)
|
|
166
176
|
soa_retry = forms.IntegerField(
|
|
167
177
|
required=True,
|
|
168
|
-
|
|
169
|
-
help_text="Retry interval for secondary name servers",
|
|
178
|
+
help_text=_("Retry interval for secondary nameservers"),
|
|
170
179
|
validators=[MinValueValidator(1)],
|
|
180
|
+
label=_("SOA Retry"),
|
|
171
181
|
)
|
|
172
182
|
soa_expire = forms.IntegerField(
|
|
173
183
|
required=True,
|
|
174
|
-
label="SOA Expire",
|
|
175
|
-
help_text="Expire time after which the zone is considered unavailable",
|
|
176
184
|
validators=[MinValueValidator(1)],
|
|
185
|
+
help_text=_("Expire time after which the zone is considered unavailable"),
|
|
186
|
+
label=_("SOA Expire"),
|
|
177
187
|
)
|
|
178
188
|
soa_minimum = forms.IntegerField(
|
|
179
189
|
required=True,
|
|
180
|
-
|
|
181
|
-
help_text="Minimum TTL for negative results, e.g. NXRRSET",
|
|
190
|
+
help_text=_("Minimum TTL for negative results, e.g. NXRRSET, NXDOMAIN"),
|
|
182
191
|
validators=[MinValueValidator(1)],
|
|
192
|
+
label=_("SOA Minimum TTL"),
|
|
183
193
|
)
|
|
184
|
-
|
|
185
|
-
label="RFC2317 Prefix",
|
|
186
|
-
help_text="IPv4 network prefix with a mask length of at least 25 bits",
|
|
187
|
-
validators=[validate_ipv4, validate_prefix, validate_rfc2317],
|
|
194
|
+
soa_serial_auto = forms.BooleanField(
|
|
188
195
|
required=False,
|
|
196
|
+
help_text=_("Automatically generate the SOA serial number"),
|
|
197
|
+
label=_("Generate SOA Serial"),
|
|
189
198
|
)
|
|
190
|
-
|
|
191
|
-
label="RFC2317 Parent Managed",
|
|
192
|
-
help_text="IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS",
|
|
199
|
+
soa_serial = forms.IntegerField(
|
|
193
200
|
required=False,
|
|
201
|
+
validators=[MinValueValidator(1)],
|
|
202
|
+
label=_("SOA Serial"),
|
|
194
203
|
)
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
|
|
205
|
+
rfc2317_prefix = RFC2317NetworkFormField(
|
|
206
|
+
required=False,
|
|
207
|
+
validators=[validate_ipv4, validate_prefix, validate_rfc2317],
|
|
208
|
+
help_text=_("RFC2317 IPv4 prefix with a length of at least 25 bits"),
|
|
209
|
+
label=_("RFC2317 Prefix"),
|
|
210
|
+
)
|
|
211
|
+
rfc2317_parent_managed = forms.BooleanField(
|
|
197
212
|
required=False,
|
|
198
|
-
|
|
213
|
+
help_text=_(
|
|
214
|
+
"IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS"
|
|
215
|
+
),
|
|
216
|
+
label=_("RFC2317 Parent Managed"),
|
|
199
217
|
)
|
|
200
218
|
|
|
201
219
|
fieldsets = (
|
|
@@ -207,7 +225,7 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
207
225
|
"nameservers",
|
|
208
226
|
"default_ttl",
|
|
209
227
|
"description",
|
|
210
|
-
name="Zone",
|
|
228
|
+
name=_("Zone"),
|
|
211
229
|
),
|
|
212
230
|
FieldSet(
|
|
213
231
|
"soa_ttl",
|
|
@@ -219,12 +237,12 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
219
237
|
"soa_minimum",
|
|
220
238
|
"soa_serial_auto",
|
|
221
239
|
"soa_serial",
|
|
222
|
-
name="SOA",
|
|
240
|
+
name=_("SOA"),
|
|
223
241
|
),
|
|
224
242
|
FieldSet(
|
|
225
243
|
"rfc2317_prefix",
|
|
226
244
|
"rfc2317_parent_managed",
|
|
227
|
-
name="
|
|
245
|
+
name=_("RFC2317"),
|
|
228
246
|
),
|
|
229
247
|
FieldSet(
|
|
230
248
|
"registrar",
|
|
@@ -233,10 +251,10 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
233
251
|
"admin_c",
|
|
234
252
|
"tech_c",
|
|
235
253
|
"billing_c",
|
|
236
|
-
name="Domain Registration",
|
|
254
|
+
name=_("Domain Registration"),
|
|
237
255
|
),
|
|
238
|
-
FieldSet("
|
|
239
|
-
FieldSet("
|
|
256
|
+
FieldSet("tenant_group", "tenant", name=_("Tenancy")),
|
|
257
|
+
FieldSet("tags", name=_("Tags")),
|
|
240
258
|
)
|
|
241
259
|
|
|
242
260
|
def __init__(self, *args, **kwargs):
|
|
@@ -301,7 +319,6 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
301
319
|
"nameservers",
|
|
302
320
|
"default_ttl",
|
|
303
321
|
"description",
|
|
304
|
-
"tags",
|
|
305
322
|
"soa_ttl",
|
|
306
323
|
"soa_mname",
|
|
307
324
|
"soa_rname",
|
|
@@ -319,11 +336,12 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
|
|
|
319
336
|
"admin_c",
|
|
320
337
|
"tech_c",
|
|
321
338
|
"billing_c",
|
|
339
|
+
"tenant_group",
|
|
322
340
|
"tenant",
|
|
341
|
+
"tags",
|
|
323
342
|
)
|
|
324
343
|
help_texts = {
|
|
325
|
-
"
|
|
326
|
-
"soa_mname": "Primary name server for the zone",
|
|
344
|
+
"soa_mname": _("Primary nameserver for the zone"),
|
|
327
345
|
}
|
|
328
346
|
|
|
329
347
|
|
|
@@ -336,20 +354,21 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
336
354
|
"status",
|
|
337
355
|
"name",
|
|
338
356
|
"nameserver_id",
|
|
357
|
+
"active",
|
|
339
358
|
"description",
|
|
340
|
-
name="Attributes",
|
|
359
|
+
name=_("Attributes"),
|
|
341
360
|
),
|
|
342
361
|
FieldSet(
|
|
343
362
|
"soa_mname_id",
|
|
344
363
|
"soa_rname",
|
|
345
364
|
"soa_serial_auto",
|
|
346
|
-
name="SOA",
|
|
365
|
+
name=_("SOA"),
|
|
347
366
|
),
|
|
348
367
|
FieldSet(
|
|
349
368
|
"rfc2317_prefix",
|
|
350
369
|
"rfc2317_parent_managed",
|
|
351
370
|
"rfc2317_parent_zone_id",
|
|
352
|
-
name="RFC2317",
|
|
371
|
+
name=_("RFC2317"),
|
|
353
372
|
),
|
|
354
373
|
FieldSet(
|
|
355
374
|
"registrar_id",
|
|
@@ -358,87 +377,95 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
358
377
|
"admin_c_id",
|
|
359
378
|
"tech_c_id",
|
|
360
379
|
"billing_c_id",
|
|
361
|
-
name="Registration",
|
|
380
|
+
name=_("Registration"),
|
|
362
381
|
),
|
|
363
|
-
FieldSet("tenant_group_id", "tenant_id", name="Tenancy"),
|
|
382
|
+
FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
|
|
364
383
|
)
|
|
365
384
|
|
|
366
385
|
view_id = DynamicModelMultipleChoiceField(
|
|
367
386
|
queryset=View.objects.all(),
|
|
368
387
|
required=False,
|
|
369
|
-
label="View",
|
|
388
|
+
label=_p("DNS", "View"),
|
|
370
389
|
)
|
|
371
390
|
status = forms.MultipleChoiceField(
|
|
372
391
|
choices=ZoneStatusChoices,
|
|
373
392
|
required=False,
|
|
393
|
+
label=_("Status"),
|
|
374
394
|
)
|
|
375
395
|
name = forms.CharField(
|
|
376
396
|
required=False,
|
|
397
|
+
label=_("Name"),
|
|
377
398
|
)
|
|
378
399
|
nameserver_id = DynamicModelMultipleChoiceField(
|
|
379
400
|
queryset=NameServer.objects.all(),
|
|
380
401
|
required=False,
|
|
381
|
-
label="Nameservers",
|
|
402
|
+
label=_("Nameservers"),
|
|
403
|
+
)
|
|
404
|
+
active = forms.NullBooleanField(
|
|
405
|
+
required=False,
|
|
406
|
+
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
407
|
+
label=_("Active"),
|
|
382
408
|
)
|
|
383
409
|
description = forms.CharField(
|
|
384
410
|
required=False,
|
|
411
|
+
label=_("Description"),
|
|
385
412
|
)
|
|
386
413
|
soa_mname_id = DynamicModelMultipleChoiceField(
|
|
387
414
|
queryset=NameServer.objects.all(),
|
|
388
|
-
label="MName",
|
|
389
415
|
required=False,
|
|
416
|
+
label=_("MName"),
|
|
390
417
|
)
|
|
391
418
|
soa_rname = forms.CharField(
|
|
392
419
|
required=False,
|
|
393
|
-
label="RName",
|
|
420
|
+
label=_("RName"),
|
|
394
421
|
)
|
|
395
422
|
soa_serial_auto = forms.NullBooleanField(
|
|
396
423
|
required=False,
|
|
397
|
-
label="Generate Serial",
|
|
398
424
|
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
425
|
+
label=_("Generate SOA Serial"),
|
|
399
426
|
)
|
|
400
427
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
401
428
|
required=False,
|
|
402
|
-
label="Prefix",
|
|
429
|
+
label=_("Prefix"),
|
|
403
430
|
)
|
|
404
431
|
rfc2317_parent_managed = forms.NullBooleanField(
|
|
405
432
|
required=False,
|
|
406
|
-
label="Parent Managed",
|
|
407
433
|
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
434
|
+
label=_("Parent Managed"),
|
|
408
435
|
)
|
|
409
436
|
rfc2317_parent_zone_id = DynamicModelMultipleChoiceField(
|
|
410
437
|
queryset=Zone.objects.all(),
|
|
411
438
|
required=False,
|
|
412
|
-
label="Parent Zone",
|
|
439
|
+
label=_("Parent Zone"),
|
|
413
440
|
)
|
|
414
441
|
registrar_id = DynamicModelMultipleChoiceField(
|
|
415
442
|
queryset=Registrar.objects.all(),
|
|
416
443
|
required=False,
|
|
417
|
-
label="Registrar",
|
|
444
|
+
label=_("Registrar"),
|
|
418
445
|
)
|
|
419
446
|
registry_domain_id = forms.CharField(
|
|
420
447
|
required=False,
|
|
421
|
-
label="Registry Domain ID",
|
|
448
|
+
label=_("Registry Domain ID"),
|
|
422
449
|
)
|
|
423
450
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
424
451
|
queryset=RegistrationContact.objects.all(),
|
|
425
452
|
required=False,
|
|
426
|
-
label="Registrant",
|
|
453
|
+
label=_("Registrant"),
|
|
427
454
|
)
|
|
428
455
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
429
456
|
queryset=RegistrationContact.objects.all(),
|
|
430
457
|
required=False,
|
|
431
|
-
label="
|
|
458
|
+
label=_("Administrative Contact"),
|
|
432
459
|
)
|
|
433
460
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
434
461
|
queryset=RegistrationContact.objects.all(),
|
|
435
462
|
required=False,
|
|
436
|
-
label="
|
|
463
|
+
label=_("Technical Contact"),
|
|
437
464
|
)
|
|
438
465
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
439
466
|
queryset=RegistrationContact.objects.all(),
|
|
440
467
|
required=False,
|
|
441
|
-
label="Billing
|
|
468
|
+
label=_("Billing Contact"),
|
|
442
469
|
)
|
|
443
470
|
tag = TagFilterField(Zone)
|
|
444
471
|
|
|
@@ -448,136 +475,146 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
448
475
|
queryset=View.objects.all(),
|
|
449
476
|
required=False,
|
|
450
477
|
to_field_name="name",
|
|
451
|
-
help_text="View the zone belongs to",
|
|
452
478
|
error_messages={
|
|
453
|
-
"invalid_choice": "View not found.",
|
|
479
|
+
"invalid_choice": _("View not found."),
|
|
454
480
|
},
|
|
481
|
+
label=_("View"),
|
|
455
482
|
)
|
|
456
483
|
status = CSVChoiceField(
|
|
457
484
|
choices=ZoneStatusChoices,
|
|
458
485
|
required=False,
|
|
459
|
-
|
|
486
|
+
label=_("Status"),
|
|
460
487
|
)
|
|
461
488
|
nameservers = CSVModelMultipleChoiceField(
|
|
462
489
|
queryset=NameServer.objects.all(),
|
|
463
490
|
to_field_name="name",
|
|
464
491
|
required=False,
|
|
465
|
-
|
|
492
|
+
label=_("Nameservers"),
|
|
466
493
|
)
|
|
467
494
|
default_ttl = forms.IntegerField(
|
|
468
495
|
required=False,
|
|
469
|
-
|
|
496
|
+
label=_("Default TTL"),
|
|
470
497
|
)
|
|
471
498
|
soa_ttl = forms.IntegerField(
|
|
472
499
|
required=False,
|
|
473
|
-
help_text="TTL for the SOA record of the zone",
|
|
500
|
+
help_text=_("TTL for the SOA record of the zone"),
|
|
501
|
+
label=_("SOA TTL"),
|
|
474
502
|
)
|
|
475
503
|
soa_mname = CSVModelChoiceField(
|
|
476
504
|
queryset=NameServer.objects.all(),
|
|
477
505
|
required=False,
|
|
478
506
|
to_field_name="name",
|
|
479
|
-
help_text="Primary name server for the zone",
|
|
480
507
|
error_messages={
|
|
481
|
-
"invalid_choice": "Nameserver not found.",
|
|
508
|
+
"invalid_choice": _("Nameserver not found."),
|
|
482
509
|
},
|
|
510
|
+
help_text=_("Primary nameserver for the zone"),
|
|
511
|
+
label=_("SOA MName"),
|
|
483
512
|
)
|
|
484
513
|
soa_rname = forms.CharField(
|
|
485
514
|
required=False,
|
|
486
|
-
help_text="Mailbox of the zone's administrator",
|
|
515
|
+
help_text=_("Mailbox of the zone's administrator"),
|
|
516
|
+
label=_("SOA RName"),
|
|
487
517
|
)
|
|
488
518
|
soa_serial_auto = forms.BooleanField(
|
|
489
519
|
required=False,
|
|
490
|
-
|
|
520
|
+
label=_("Generate SOA Serial"),
|
|
491
521
|
)
|
|
492
522
|
soa_serial = forms.IntegerField(
|
|
493
523
|
required=False,
|
|
494
|
-
|
|
524
|
+
label=_("SOA Serial"),
|
|
495
525
|
)
|
|
496
526
|
soa_refresh = forms.IntegerField(
|
|
497
527
|
required=False,
|
|
498
|
-
help_text="Refresh interval for secondary
|
|
528
|
+
help_text=_("Refresh interval for secondary nameservers"),
|
|
529
|
+
label=_("SOA Refresh"),
|
|
499
530
|
)
|
|
500
531
|
soa_retry = forms.IntegerField(
|
|
501
532
|
required=False,
|
|
502
|
-
help_text="Retry interval for secondary
|
|
533
|
+
help_text=_("Retry interval for secondary nameservers"),
|
|
534
|
+
label=_("SOA Retry"),
|
|
503
535
|
)
|
|
504
536
|
soa_expire = forms.IntegerField(
|
|
505
537
|
required=False,
|
|
506
|
-
help_text="Expire time after which the zone is considered unavailable",
|
|
538
|
+
help_text=_("Expire time after which the zone is considered unavailable"),
|
|
539
|
+
label=_("SOA Expire"),
|
|
507
540
|
)
|
|
508
541
|
soa_minimum = forms.IntegerField(
|
|
509
542
|
required=False,
|
|
510
|
-
help_text="Minimum TTL for negative results, e.g. NXRRSET",
|
|
543
|
+
help_text=_("Minimum TTL for negative results, e.g. NXRRSET, NXDOMAIN"),
|
|
544
|
+
label=_("SOA Minimum TTL"),
|
|
511
545
|
)
|
|
512
546
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
513
547
|
required=False,
|
|
514
|
-
help_text="RFC2317 IPv4 prefix with a length of at least 25 bits",
|
|
548
|
+
help_text=_("RFC2317 IPv4 prefix with a length of at least 25 bits"),
|
|
549
|
+
label=_("RFC2317 Prefix"),
|
|
515
550
|
)
|
|
516
551
|
rfc2317_parent_managed = forms.BooleanField(
|
|
517
552
|
required=False,
|
|
518
|
-
|
|
519
|
-
|
|
553
|
+
help_text=_(
|
|
554
|
+
"IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS"
|
|
555
|
+
),
|
|
556
|
+
label=_("RFC2317 Parent Managed"),
|
|
520
557
|
)
|
|
521
558
|
registrar = CSVModelChoiceField(
|
|
522
559
|
queryset=Registrar.objects.all(),
|
|
523
560
|
required=False,
|
|
524
561
|
to_field_name="name",
|
|
525
|
-
help_text="Registrar the domain is registered with",
|
|
526
562
|
error_messages={
|
|
527
|
-
"invalid_choice": "Registrar not found.",
|
|
563
|
+
"invalid_choice": _("Registrar not found."),
|
|
528
564
|
},
|
|
565
|
+
label=_("Registrar"),
|
|
529
566
|
)
|
|
530
567
|
registry_domain_id = forms.CharField(
|
|
531
568
|
required=False,
|
|
532
|
-
|
|
569
|
+
label=_("Registry Domain ID"),
|
|
533
570
|
)
|
|
534
571
|
registrant = CSVModelChoiceField(
|
|
535
572
|
queryset=RegistrationContact.objects.all(),
|
|
536
573
|
required=False,
|
|
537
574
|
to_field_name="contact_id",
|
|
538
|
-
help_text="Owner of the domain",
|
|
539
575
|
error_messages={
|
|
540
|
-
"invalid_choice": "Registrant contact ID not found",
|
|
576
|
+
"invalid_choice": _("Registrant contact ID not found"),
|
|
541
577
|
},
|
|
578
|
+
label=_("Registrant"),
|
|
542
579
|
)
|
|
543
580
|
admin_c = CSVModelChoiceField(
|
|
544
581
|
queryset=RegistrationContact.objects.all(),
|
|
545
582
|
required=False,
|
|
546
583
|
to_field_name="contact_id",
|
|
547
|
-
help_text="Administrative contact for the domain",
|
|
548
584
|
error_messages={
|
|
549
|
-
"invalid_choice": "Administrative contact ID not found",
|
|
585
|
+
"invalid_choice": _("Administrative contact ID not found"),
|
|
550
586
|
},
|
|
587
|
+
label=_("Administrative Contact"),
|
|
551
588
|
)
|
|
552
589
|
tech_c = CSVModelChoiceField(
|
|
553
590
|
queryset=RegistrationContact.objects.all(),
|
|
554
591
|
required=False,
|
|
555
592
|
to_field_name="contact_id",
|
|
556
|
-
help_text="Technical contact for the domain",
|
|
557
593
|
error_messages={
|
|
558
|
-
"invalid_choice": "Technical contact ID not found",
|
|
594
|
+
"invalid_choice": _("Technical contact ID not found"),
|
|
559
595
|
},
|
|
596
|
+
label=_("Technical Contact"),
|
|
560
597
|
)
|
|
561
598
|
billing_c = CSVModelChoiceField(
|
|
562
599
|
queryset=RegistrationContact.objects.all(),
|
|
563
600
|
required=False,
|
|
564
601
|
to_field_name="contact_id",
|
|
565
|
-
help_text="Billing contact for the domain",
|
|
566
602
|
error_messages={
|
|
567
|
-
"invalid_choice": "Billing contact ID not found",
|
|
603
|
+
"invalid_choice": _("Billing contact ID not found"),
|
|
568
604
|
},
|
|
605
|
+
label=_("Billing Contact"),
|
|
569
606
|
)
|
|
570
607
|
tenant = CSVModelChoiceField(
|
|
571
608
|
queryset=Tenant.objects.all(),
|
|
572
609
|
required=False,
|
|
573
610
|
to_field_name="name",
|
|
574
|
-
|
|
611
|
+
label=_("Tenant"),
|
|
575
612
|
)
|
|
576
613
|
template = CSVModelChoiceField(
|
|
577
614
|
queryset=ZoneTemplate.objects.all(),
|
|
578
615
|
required=False,
|
|
579
616
|
to_field_name="name",
|
|
580
|
-
label="Template",
|
|
617
|
+
label=_("Template"),
|
|
581
618
|
)
|
|
582
619
|
|
|
583
620
|
class Meta:
|
|
@@ -638,108 +675,124 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
638
675
|
view = DynamicModelChoiceField(
|
|
639
676
|
queryset=View.objects.all(),
|
|
640
677
|
required=False,
|
|
641
|
-
label="View",
|
|
678
|
+
label=_p("DNS", "View"),
|
|
642
679
|
)
|
|
643
680
|
status = forms.ChoiceField(
|
|
644
681
|
choices=add_blank_choice(ZoneStatusChoices),
|
|
645
682
|
required=False,
|
|
683
|
+
label=_("Status"),
|
|
646
684
|
)
|
|
647
685
|
nameservers = DynamicModelMultipleChoiceField(
|
|
648
686
|
queryset=NameServer.objects.all(),
|
|
649
687
|
required=False,
|
|
688
|
+
label=_("Nameservers"),
|
|
650
689
|
)
|
|
651
690
|
default_ttl = forms.IntegerField(
|
|
652
691
|
required=False,
|
|
653
|
-
label="Default TTL",
|
|
654
692
|
validators=[MinValueValidator(1)],
|
|
693
|
+
label=_("Default TTL"),
|
|
694
|
+
)
|
|
695
|
+
description = forms.CharField(
|
|
696
|
+
max_length=200,
|
|
697
|
+
required=False,
|
|
698
|
+
label=_("Description"),
|
|
655
699
|
)
|
|
656
|
-
description = forms.CharField(max_length=200, required=False)
|
|
657
700
|
soa_ttl = forms.IntegerField(
|
|
658
701
|
required=False,
|
|
659
|
-
label="SOA TTL",
|
|
660
702
|
validators=[MinValueValidator(1)],
|
|
703
|
+
label=_("SOA TTL"),
|
|
661
704
|
)
|
|
662
705
|
soa_mname = DynamicModelChoiceField(
|
|
663
706
|
queryset=NameServer.objects.all(),
|
|
664
707
|
required=False,
|
|
665
|
-
label="SOA
|
|
708
|
+
label=_("SOA MName"),
|
|
666
709
|
)
|
|
667
710
|
soa_rname = forms.CharField(
|
|
668
711
|
required=False,
|
|
669
|
-
label="SOA RName",
|
|
712
|
+
label=_("SOA RName"),
|
|
670
713
|
)
|
|
671
714
|
soa_serial_auto = forms.NullBooleanField(
|
|
672
715
|
required=False,
|
|
673
716
|
widget=BulkEditNullBooleanSelect(),
|
|
674
|
-
label="Generate SOA Serial",
|
|
717
|
+
label=_("Generate SOA Serial"),
|
|
675
718
|
)
|
|
676
719
|
soa_serial = forms.IntegerField(
|
|
677
720
|
required=False,
|
|
678
|
-
label="SOA Serial",
|
|
679
721
|
validators=[MinValueValidator(1), MaxValueValidator(4294967295)],
|
|
722
|
+
label=_("SOA Serial"),
|
|
680
723
|
)
|
|
681
724
|
soa_refresh = forms.IntegerField(
|
|
682
725
|
required=False,
|
|
683
|
-
label="SOA Refresh",
|
|
684
726
|
validators=[MinValueValidator(1)],
|
|
727
|
+
label=_("SOA Refresh"),
|
|
685
728
|
)
|
|
686
729
|
soa_retry = forms.IntegerField(
|
|
687
730
|
required=False,
|
|
688
|
-
label="SOA Retry",
|
|
689
731
|
validators=[MinValueValidator(1)],
|
|
732
|
+
label=_("SOA Retry"),
|
|
690
733
|
)
|
|
691
734
|
soa_expire = forms.IntegerField(
|
|
692
735
|
required=False,
|
|
693
|
-
label="SOA Expire",
|
|
694
736
|
validators=[MinValueValidator(1)],
|
|
737
|
+
label=_("SOA Expire"),
|
|
695
738
|
)
|
|
696
739
|
soa_minimum = forms.IntegerField(
|
|
697
740
|
required=False,
|
|
698
|
-
label="SOA Minimum TTL",
|
|
699
741
|
validators=[MinValueValidator(1)],
|
|
742
|
+
label=_("SOA Minimum TTL"),
|
|
700
743
|
)
|
|
701
744
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
702
745
|
required=False,
|
|
703
|
-
label="RFC2317 Prefix",
|
|
704
|
-
help_text="IPv4 network prefix with a mask length of at least 25 bits",
|
|
705
746
|
validators=[validate_ipv4, validate_prefix, validate_rfc2317],
|
|
747
|
+
help_text=_("RFC2317 IPv4 prefix with a length of at least 25 bits"),
|
|
748
|
+
label=_("RFC2317 Prefix"),
|
|
706
749
|
)
|
|
707
750
|
rfc2317_parent_managed = forms.NullBooleanField(
|
|
708
751
|
required=False,
|
|
709
752
|
widget=BulkEditNullBooleanSelect(),
|
|
710
|
-
|
|
711
|
-
|
|
753
|
+
help_text=_(
|
|
754
|
+
"IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS"
|
|
755
|
+
),
|
|
756
|
+
label=_("RFC2317 Parent Managed"),
|
|
712
757
|
)
|
|
713
758
|
registrar = DynamicModelChoiceField(
|
|
714
759
|
queryset=Registrar.objects.all(),
|
|
715
760
|
required=False,
|
|
761
|
+
label=_("Registrar"),
|
|
716
762
|
)
|
|
717
763
|
registry_domain_id = forms.CharField(
|
|
718
764
|
required=False,
|
|
719
|
-
label="Registry Domain ID",
|
|
765
|
+
label=_("Registry Domain ID"),
|
|
720
766
|
)
|
|
721
767
|
registrant = DynamicModelChoiceField(
|
|
722
768
|
queryset=RegistrationContact.objects.all(),
|
|
723
769
|
required=False,
|
|
770
|
+
label=_("Registrant"),
|
|
724
771
|
)
|
|
725
772
|
admin_c = DynamicModelChoiceField(
|
|
726
773
|
queryset=RegistrationContact.objects.all(),
|
|
727
774
|
required=False,
|
|
728
|
-
label="Administrative Contact",
|
|
775
|
+
label=_("Administrative Contact"),
|
|
729
776
|
)
|
|
730
777
|
tech_c = DynamicModelChoiceField(
|
|
731
778
|
queryset=RegistrationContact.objects.all(),
|
|
732
779
|
required=False,
|
|
733
|
-
label="Technical Contact",
|
|
780
|
+
label=_("Technical Contact"),
|
|
734
781
|
)
|
|
735
782
|
billing_c = DynamicModelChoiceField(
|
|
736
783
|
queryset=RegistrationContact.objects.all(),
|
|
737
784
|
required=False,
|
|
738
|
-
label="Billing Contact",
|
|
785
|
+
label=_("Billing Contact"),
|
|
786
|
+
)
|
|
787
|
+
tenant_group = DynamicModelChoiceField(
|
|
788
|
+
queryset=TenantGroup.objects.all(),
|
|
789
|
+
required=False,
|
|
790
|
+
label=_("Tenant Group"),
|
|
739
791
|
)
|
|
740
792
|
tenant = DynamicModelChoiceField(
|
|
741
793
|
queryset=Tenant.objects.all(),
|
|
742
794
|
required=False,
|
|
795
|
+
label=_("Tenant"),
|
|
743
796
|
)
|
|
744
797
|
|
|
745
798
|
model = Zone
|
|
@@ -751,7 +804,7 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
751
804
|
"nameservers",
|
|
752
805
|
"default_ttl",
|
|
753
806
|
"description",
|
|
754
|
-
name="Attributes",
|
|
807
|
+
name=_("Attributes"),
|
|
755
808
|
),
|
|
756
809
|
FieldSet(
|
|
757
810
|
"soa_ttl",
|
|
@@ -763,12 +816,12 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
763
816
|
"soa_minimum",
|
|
764
817
|
"soa_serial_auto",
|
|
765
818
|
"soa_serial",
|
|
766
|
-
name="SOA",
|
|
819
|
+
name=_("SOA"),
|
|
767
820
|
),
|
|
768
821
|
FieldSet(
|
|
769
822
|
"rfc2317_prefix",
|
|
770
823
|
"rfc2317_parent_managed",
|
|
771
|
-
name="
|
|
824
|
+
name=_("RFC2317"),
|
|
772
825
|
),
|
|
773
826
|
FieldSet(
|
|
774
827
|
"registrar",
|
|
@@ -777,9 +830,9 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
777
830
|
"admin_c",
|
|
778
831
|
"tech_c",
|
|
779
832
|
"billing_c",
|
|
780
|
-
name="Domain Registration",
|
|
833
|
+
name=_("Domain Registration"),
|
|
781
834
|
),
|
|
782
|
-
FieldSet("tenant_group", "tenant", name="Tenancy"),
|
|
835
|
+
FieldSet("tenant_group", "tenant", name=_("Tenancy")),
|
|
783
836
|
)
|
|
784
837
|
|
|
785
838
|
nullable_fields = (
|