netbox-plugin-dns 1.1.2__py3-none-any.whl → 1.1.3__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 +6 -5
- 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 +6 -4
- netbox_dns/fields/address.py +2 -1
- 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 +10 -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 +43 -26
- 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 +167 -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 +63 -30
- netbox_dns/models/record_template.py +16 -8
- 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 +65 -43
- 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 +9 -4
- 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.3.dist-info}/METADATA +1 -1
- netbox_plugin_dns-1.1.3.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.3.dist-info}/LICENSE +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/WHEEL +0 -0
- {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.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
|
|
|
@@ -337,19 +355,19 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
337
355
|
"name",
|
|
338
356
|
"nameserver_id",
|
|
339
357
|
"description",
|
|
340
|
-
name="Attributes",
|
|
358
|
+
name=_("Attributes"),
|
|
341
359
|
),
|
|
342
360
|
FieldSet(
|
|
343
361
|
"soa_mname_id",
|
|
344
362
|
"soa_rname",
|
|
345
363
|
"soa_serial_auto",
|
|
346
|
-
name="SOA",
|
|
364
|
+
name=_("SOA"),
|
|
347
365
|
),
|
|
348
366
|
FieldSet(
|
|
349
367
|
"rfc2317_prefix",
|
|
350
368
|
"rfc2317_parent_managed",
|
|
351
369
|
"rfc2317_parent_zone_id",
|
|
352
|
-
name="RFC2317",
|
|
370
|
+
name=_("RFC2317"),
|
|
353
371
|
),
|
|
354
372
|
FieldSet(
|
|
355
373
|
"registrar_id",
|
|
@@ -358,87 +376,90 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
|
|
358
376
|
"admin_c_id",
|
|
359
377
|
"tech_c_id",
|
|
360
378
|
"billing_c_id",
|
|
361
|
-
name="Registration",
|
|
379
|
+
name=_("Registration"),
|
|
362
380
|
),
|
|
363
|
-
FieldSet("tenant_group_id", "tenant_id", name="Tenancy"),
|
|
381
|
+
FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
|
|
364
382
|
)
|
|
365
383
|
|
|
366
384
|
view_id = DynamicModelMultipleChoiceField(
|
|
367
385
|
queryset=View.objects.all(),
|
|
368
386
|
required=False,
|
|
369
|
-
label="View",
|
|
387
|
+
label=_p("DNS", "View"),
|
|
370
388
|
)
|
|
371
389
|
status = forms.MultipleChoiceField(
|
|
372
390
|
choices=ZoneStatusChoices,
|
|
373
391
|
required=False,
|
|
392
|
+
label=_("Status"),
|
|
374
393
|
)
|
|
375
394
|
name = forms.CharField(
|
|
376
395
|
required=False,
|
|
396
|
+
label=_("Name"),
|
|
377
397
|
)
|
|
378
398
|
nameserver_id = DynamicModelMultipleChoiceField(
|
|
379
399
|
queryset=NameServer.objects.all(),
|
|
380
400
|
required=False,
|
|
381
|
-
label="Nameservers",
|
|
401
|
+
label=_("Nameservers"),
|
|
382
402
|
)
|
|
383
403
|
description = forms.CharField(
|
|
384
404
|
required=False,
|
|
405
|
+
label=_("Description"),
|
|
385
406
|
)
|
|
386
407
|
soa_mname_id = DynamicModelMultipleChoiceField(
|
|
387
408
|
queryset=NameServer.objects.all(),
|
|
388
|
-
label="MName",
|
|
389
409
|
required=False,
|
|
410
|
+
label=_("MName"),
|
|
390
411
|
)
|
|
391
412
|
soa_rname = forms.CharField(
|
|
392
413
|
required=False,
|
|
393
|
-
label="RName",
|
|
414
|
+
label=_("RName"),
|
|
394
415
|
)
|
|
395
416
|
soa_serial_auto = forms.NullBooleanField(
|
|
396
417
|
required=False,
|
|
397
|
-
label="Generate Serial",
|
|
398
418
|
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
419
|
+
label=_("Generate SOA Serial"),
|
|
399
420
|
)
|
|
400
421
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
401
422
|
required=False,
|
|
402
|
-
label="Prefix",
|
|
423
|
+
label=_("Prefix"),
|
|
403
424
|
)
|
|
404
425
|
rfc2317_parent_managed = forms.NullBooleanField(
|
|
405
426
|
required=False,
|
|
406
|
-
label="Parent Managed",
|
|
407
427
|
widget=forms.Select(choices=BOOLEAN_WITH_BLANK_CHOICES),
|
|
428
|
+
label=_("Parent Managed"),
|
|
408
429
|
)
|
|
409
430
|
rfc2317_parent_zone_id = DynamicModelMultipleChoiceField(
|
|
410
431
|
queryset=Zone.objects.all(),
|
|
411
432
|
required=False,
|
|
412
|
-
label="Parent Zone",
|
|
433
|
+
label=_("Parent Zone"),
|
|
413
434
|
)
|
|
414
435
|
registrar_id = DynamicModelMultipleChoiceField(
|
|
415
436
|
queryset=Registrar.objects.all(),
|
|
416
437
|
required=False,
|
|
417
|
-
label="Registrar",
|
|
438
|
+
label=_("Registrar"),
|
|
418
439
|
)
|
|
419
440
|
registry_domain_id = forms.CharField(
|
|
420
441
|
required=False,
|
|
421
|
-
label="Registry Domain ID",
|
|
442
|
+
label=_("Registry Domain ID"),
|
|
422
443
|
)
|
|
423
444
|
registrant_id = DynamicModelMultipleChoiceField(
|
|
424
445
|
queryset=RegistrationContact.objects.all(),
|
|
425
446
|
required=False,
|
|
426
|
-
label="Registrant",
|
|
447
|
+
label=_("Registrant"),
|
|
427
448
|
)
|
|
428
449
|
admin_c_id = DynamicModelMultipleChoiceField(
|
|
429
450
|
queryset=RegistrationContact.objects.all(),
|
|
430
451
|
required=False,
|
|
431
|
-
label="
|
|
452
|
+
label=_("Administrative Contact"),
|
|
432
453
|
)
|
|
433
454
|
tech_c_id = DynamicModelMultipleChoiceField(
|
|
434
455
|
queryset=RegistrationContact.objects.all(),
|
|
435
456
|
required=False,
|
|
436
|
-
label="
|
|
457
|
+
label=_("Technical Contact"),
|
|
437
458
|
)
|
|
438
459
|
billing_c_id = DynamicModelMultipleChoiceField(
|
|
439
460
|
queryset=RegistrationContact.objects.all(),
|
|
440
461
|
required=False,
|
|
441
|
-
label="Billing
|
|
462
|
+
label=_("Billing Contact"),
|
|
442
463
|
)
|
|
443
464
|
tag = TagFilterField(Zone)
|
|
444
465
|
|
|
@@ -448,136 +469,146 @@ class ZoneImportForm(ZoneTemplateUpdateMixin, NetBoxModelImportForm):
|
|
|
448
469
|
queryset=View.objects.all(),
|
|
449
470
|
required=False,
|
|
450
471
|
to_field_name="name",
|
|
451
|
-
help_text="View the zone belongs to",
|
|
452
472
|
error_messages={
|
|
453
|
-
"invalid_choice": "View not found.",
|
|
473
|
+
"invalid_choice": _("View not found."),
|
|
454
474
|
},
|
|
475
|
+
label=_("View"),
|
|
455
476
|
)
|
|
456
477
|
status = CSVChoiceField(
|
|
457
478
|
choices=ZoneStatusChoices,
|
|
458
479
|
required=False,
|
|
459
|
-
|
|
480
|
+
label=_("Status"),
|
|
460
481
|
)
|
|
461
482
|
nameservers = CSVModelMultipleChoiceField(
|
|
462
483
|
queryset=NameServer.objects.all(),
|
|
463
484
|
to_field_name="name",
|
|
464
485
|
required=False,
|
|
465
|
-
|
|
486
|
+
label=_("Nameservers"),
|
|
466
487
|
)
|
|
467
488
|
default_ttl = forms.IntegerField(
|
|
468
489
|
required=False,
|
|
469
|
-
|
|
490
|
+
label=_("Default TTL"),
|
|
470
491
|
)
|
|
471
492
|
soa_ttl = forms.IntegerField(
|
|
472
493
|
required=False,
|
|
473
|
-
help_text="TTL for the SOA record of the zone",
|
|
494
|
+
help_text=_("TTL for the SOA record of the zone"),
|
|
495
|
+
label=_("SOA TTL"),
|
|
474
496
|
)
|
|
475
497
|
soa_mname = CSVModelChoiceField(
|
|
476
498
|
queryset=NameServer.objects.all(),
|
|
477
499
|
required=False,
|
|
478
500
|
to_field_name="name",
|
|
479
|
-
help_text="Primary name server for the zone",
|
|
480
501
|
error_messages={
|
|
481
|
-
"invalid_choice": "Nameserver not found.",
|
|
502
|
+
"invalid_choice": _("Nameserver not found."),
|
|
482
503
|
},
|
|
504
|
+
help_text=_("Primary nameserver for the zone"),
|
|
505
|
+
label=_("SOA MName"),
|
|
483
506
|
)
|
|
484
507
|
soa_rname = forms.CharField(
|
|
485
508
|
required=False,
|
|
486
|
-
help_text="Mailbox of the zone's administrator",
|
|
509
|
+
help_text=_("Mailbox of the zone's administrator"),
|
|
510
|
+
label=_("SOA RName"),
|
|
487
511
|
)
|
|
488
512
|
soa_serial_auto = forms.BooleanField(
|
|
489
513
|
required=False,
|
|
490
|
-
|
|
514
|
+
label=_("Generate SOA Serial"),
|
|
491
515
|
)
|
|
492
516
|
soa_serial = forms.IntegerField(
|
|
493
517
|
required=False,
|
|
494
|
-
|
|
518
|
+
label=_("SOA Serial"),
|
|
495
519
|
)
|
|
496
520
|
soa_refresh = forms.IntegerField(
|
|
497
521
|
required=False,
|
|
498
|
-
help_text="Refresh interval for secondary
|
|
522
|
+
help_text=_("Refresh interval for secondary nameservers"),
|
|
523
|
+
label=_("SOA Refresh"),
|
|
499
524
|
)
|
|
500
525
|
soa_retry = forms.IntegerField(
|
|
501
526
|
required=False,
|
|
502
|
-
help_text="Retry interval for secondary
|
|
527
|
+
help_text=_("Retry interval for secondary nameservers"),
|
|
528
|
+
label=_("SOA Retry"),
|
|
503
529
|
)
|
|
504
530
|
soa_expire = forms.IntegerField(
|
|
505
531
|
required=False,
|
|
506
|
-
help_text="Expire time after which the zone is considered unavailable",
|
|
532
|
+
help_text=_("Expire time after which the zone is considered unavailable"),
|
|
533
|
+
label=_("SOA Expire"),
|
|
507
534
|
)
|
|
508
535
|
soa_minimum = forms.IntegerField(
|
|
509
536
|
required=False,
|
|
510
|
-
help_text="Minimum TTL for negative results, e.g. NXRRSET",
|
|
537
|
+
help_text=_("Minimum TTL for negative results, e.g. NXRRSET, NXDOMAIN"),
|
|
538
|
+
label=_("SOA Minimum TTL"),
|
|
511
539
|
)
|
|
512
540
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
513
541
|
required=False,
|
|
514
|
-
help_text="RFC2317 IPv4 prefix with a length of at least 25 bits",
|
|
542
|
+
help_text=_("RFC2317 IPv4 prefix with a length of at least 25 bits"),
|
|
543
|
+
label=_("RFC2317 Prefix"),
|
|
515
544
|
)
|
|
516
545
|
rfc2317_parent_managed = forms.BooleanField(
|
|
517
546
|
required=False,
|
|
518
|
-
|
|
519
|
-
|
|
547
|
+
help_text=_(
|
|
548
|
+
"IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS"
|
|
549
|
+
),
|
|
550
|
+
label=_("RFC2317 Parent Managed"),
|
|
520
551
|
)
|
|
521
552
|
registrar = CSVModelChoiceField(
|
|
522
553
|
queryset=Registrar.objects.all(),
|
|
523
554
|
required=False,
|
|
524
555
|
to_field_name="name",
|
|
525
|
-
help_text="Registrar the domain is registered with",
|
|
526
556
|
error_messages={
|
|
527
|
-
"invalid_choice": "Registrar not found.",
|
|
557
|
+
"invalid_choice": _("Registrar not found."),
|
|
528
558
|
},
|
|
559
|
+
label=_("Registrar"),
|
|
529
560
|
)
|
|
530
561
|
registry_domain_id = forms.CharField(
|
|
531
562
|
required=False,
|
|
532
|
-
|
|
563
|
+
label=_("Registry Domain ID"),
|
|
533
564
|
)
|
|
534
565
|
registrant = CSVModelChoiceField(
|
|
535
566
|
queryset=RegistrationContact.objects.all(),
|
|
536
567
|
required=False,
|
|
537
568
|
to_field_name="contact_id",
|
|
538
|
-
help_text="Owner of the domain",
|
|
539
569
|
error_messages={
|
|
540
|
-
"invalid_choice": "Registrant contact ID not found",
|
|
570
|
+
"invalid_choice": _("Registrant contact ID not found"),
|
|
541
571
|
},
|
|
572
|
+
label=_("Registrant"),
|
|
542
573
|
)
|
|
543
574
|
admin_c = CSVModelChoiceField(
|
|
544
575
|
queryset=RegistrationContact.objects.all(),
|
|
545
576
|
required=False,
|
|
546
577
|
to_field_name="contact_id",
|
|
547
|
-
help_text="Administrative contact for the domain",
|
|
548
578
|
error_messages={
|
|
549
|
-
"invalid_choice": "Administrative contact ID not found",
|
|
579
|
+
"invalid_choice": _("Administrative contact ID not found"),
|
|
550
580
|
},
|
|
581
|
+
label=_("Administrative Contact"),
|
|
551
582
|
)
|
|
552
583
|
tech_c = CSVModelChoiceField(
|
|
553
584
|
queryset=RegistrationContact.objects.all(),
|
|
554
585
|
required=False,
|
|
555
586
|
to_field_name="contact_id",
|
|
556
|
-
help_text="Technical contact for the domain",
|
|
557
587
|
error_messages={
|
|
558
|
-
"invalid_choice": "Technical contact ID not found",
|
|
588
|
+
"invalid_choice": _("Technical contact ID not found"),
|
|
559
589
|
},
|
|
590
|
+
label=_("Technical Contact"),
|
|
560
591
|
)
|
|
561
592
|
billing_c = CSVModelChoiceField(
|
|
562
593
|
queryset=RegistrationContact.objects.all(),
|
|
563
594
|
required=False,
|
|
564
595
|
to_field_name="contact_id",
|
|
565
|
-
help_text="Billing contact for the domain",
|
|
566
596
|
error_messages={
|
|
567
|
-
"invalid_choice": "Billing contact ID not found",
|
|
597
|
+
"invalid_choice": _("Billing contact ID not found"),
|
|
568
598
|
},
|
|
599
|
+
label=_("Billing Contact"),
|
|
569
600
|
)
|
|
570
601
|
tenant = CSVModelChoiceField(
|
|
571
602
|
queryset=Tenant.objects.all(),
|
|
572
603
|
required=False,
|
|
573
604
|
to_field_name="name",
|
|
574
|
-
|
|
605
|
+
label=_("Tenant"),
|
|
575
606
|
)
|
|
576
607
|
template = CSVModelChoiceField(
|
|
577
608
|
queryset=ZoneTemplate.objects.all(),
|
|
578
609
|
required=False,
|
|
579
610
|
to_field_name="name",
|
|
580
|
-
label="Template",
|
|
611
|
+
label=_("Template"),
|
|
581
612
|
)
|
|
582
613
|
|
|
583
614
|
class Meta:
|
|
@@ -638,108 +669,124 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
638
669
|
view = DynamicModelChoiceField(
|
|
639
670
|
queryset=View.objects.all(),
|
|
640
671
|
required=False,
|
|
641
|
-
label="View",
|
|
672
|
+
label=_p("DNS", "View"),
|
|
642
673
|
)
|
|
643
674
|
status = forms.ChoiceField(
|
|
644
675
|
choices=add_blank_choice(ZoneStatusChoices),
|
|
645
676
|
required=False,
|
|
677
|
+
label=_("Status"),
|
|
646
678
|
)
|
|
647
679
|
nameservers = DynamicModelMultipleChoiceField(
|
|
648
680
|
queryset=NameServer.objects.all(),
|
|
649
681
|
required=False,
|
|
682
|
+
label=_("Nameservers"),
|
|
650
683
|
)
|
|
651
684
|
default_ttl = forms.IntegerField(
|
|
652
685
|
required=False,
|
|
653
|
-
label="Default TTL",
|
|
654
686
|
validators=[MinValueValidator(1)],
|
|
687
|
+
label=_("Default TTL"),
|
|
688
|
+
)
|
|
689
|
+
description = forms.CharField(
|
|
690
|
+
max_length=200,
|
|
691
|
+
required=False,
|
|
692
|
+
label=_("Description"),
|
|
655
693
|
)
|
|
656
|
-
description = forms.CharField(max_length=200, required=False)
|
|
657
694
|
soa_ttl = forms.IntegerField(
|
|
658
695
|
required=False,
|
|
659
|
-
label="SOA TTL",
|
|
660
696
|
validators=[MinValueValidator(1)],
|
|
697
|
+
label=_("SOA TTL"),
|
|
661
698
|
)
|
|
662
699
|
soa_mname = DynamicModelChoiceField(
|
|
663
700
|
queryset=NameServer.objects.all(),
|
|
664
701
|
required=False,
|
|
665
|
-
label="SOA
|
|
702
|
+
label=_("SOA MName"),
|
|
666
703
|
)
|
|
667
704
|
soa_rname = forms.CharField(
|
|
668
705
|
required=False,
|
|
669
|
-
label="SOA RName",
|
|
706
|
+
label=_("SOA RName"),
|
|
670
707
|
)
|
|
671
708
|
soa_serial_auto = forms.NullBooleanField(
|
|
672
709
|
required=False,
|
|
673
710
|
widget=BulkEditNullBooleanSelect(),
|
|
674
|
-
label="Generate SOA Serial",
|
|
711
|
+
label=_("Generate SOA Serial"),
|
|
675
712
|
)
|
|
676
713
|
soa_serial = forms.IntegerField(
|
|
677
714
|
required=False,
|
|
678
|
-
label="SOA Serial",
|
|
679
715
|
validators=[MinValueValidator(1), MaxValueValidator(4294967295)],
|
|
716
|
+
label=_("SOA Serial"),
|
|
680
717
|
)
|
|
681
718
|
soa_refresh = forms.IntegerField(
|
|
682
719
|
required=False,
|
|
683
|
-
label="SOA Refresh",
|
|
684
720
|
validators=[MinValueValidator(1)],
|
|
721
|
+
label=_("SOA Refresh"),
|
|
685
722
|
)
|
|
686
723
|
soa_retry = forms.IntegerField(
|
|
687
724
|
required=False,
|
|
688
|
-
label="SOA Retry",
|
|
689
725
|
validators=[MinValueValidator(1)],
|
|
726
|
+
label=_("SOA Retry"),
|
|
690
727
|
)
|
|
691
728
|
soa_expire = forms.IntegerField(
|
|
692
729
|
required=False,
|
|
693
|
-
label="SOA Expire",
|
|
694
730
|
validators=[MinValueValidator(1)],
|
|
731
|
+
label=_("SOA Expire"),
|
|
695
732
|
)
|
|
696
733
|
soa_minimum = forms.IntegerField(
|
|
697
734
|
required=False,
|
|
698
|
-
label="SOA Minimum TTL",
|
|
699
735
|
validators=[MinValueValidator(1)],
|
|
736
|
+
label=_("SOA Minimum TTL"),
|
|
700
737
|
)
|
|
701
738
|
rfc2317_prefix = RFC2317NetworkFormField(
|
|
702
739
|
required=False,
|
|
703
|
-
label="RFC2317 Prefix",
|
|
704
|
-
help_text="IPv4 network prefix with a mask length of at least 25 bits",
|
|
705
740
|
validators=[validate_ipv4, validate_prefix, validate_rfc2317],
|
|
741
|
+
help_text=_("RFC2317 IPv4 prefix with a length of at least 25 bits"),
|
|
742
|
+
label=_("RFC2317 Prefix"),
|
|
706
743
|
)
|
|
707
744
|
rfc2317_parent_managed = forms.NullBooleanField(
|
|
708
745
|
required=False,
|
|
709
746
|
widget=BulkEditNullBooleanSelect(),
|
|
710
|
-
|
|
711
|
-
|
|
747
|
+
help_text=_(
|
|
748
|
+
"IPv4 reverse zone for deletgating the RFC2317 PTR records is managed in NetBox DNS"
|
|
749
|
+
),
|
|
750
|
+
label=_("RFC2317 Parent Managed"),
|
|
712
751
|
)
|
|
713
752
|
registrar = DynamicModelChoiceField(
|
|
714
753
|
queryset=Registrar.objects.all(),
|
|
715
754
|
required=False,
|
|
755
|
+
label=_("Registrar"),
|
|
716
756
|
)
|
|
717
757
|
registry_domain_id = forms.CharField(
|
|
718
758
|
required=False,
|
|
719
|
-
label="Registry Domain ID",
|
|
759
|
+
label=_("Registry Domain ID"),
|
|
720
760
|
)
|
|
721
761
|
registrant = DynamicModelChoiceField(
|
|
722
762
|
queryset=RegistrationContact.objects.all(),
|
|
723
763
|
required=False,
|
|
764
|
+
label=_("Registrant"),
|
|
724
765
|
)
|
|
725
766
|
admin_c = DynamicModelChoiceField(
|
|
726
767
|
queryset=RegistrationContact.objects.all(),
|
|
727
768
|
required=False,
|
|
728
|
-
label="Administrative Contact",
|
|
769
|
+
label=_("Administrative Contact"),
|
|
729
770
|
)
|
|
730
771
|
tech_c = DynamicModelChoiceField(
|
|
731
772
|
queryset=RegistrationContact.objects.all(),
|
|
732
773
|
required=False,
|
|
733
|
-
label="Technical Contact",
|
|
774
|
+
label=_("Technical Contact"),
|
|
734
775
|
)
|
|
735
776
|
billing_c = DynamicModelChoiceField(
|
|
736
777
|
queryset=RegistrationContact.objects.all(),
|
|
737
778
|
required=False,
|
|
738
|
-
label="Billing Contact",
|
|
779
|
+
label=_("Billing Contact"),
|
|
780
|
+
)
|
|
781
|
+
tenant_group = DynamicModelChoiceField(
|
|
782
|
+
queryset=TenantGroup.objects.all(),
|
|
783
|
+
required=False,
|
|
784
|
+
label=_("Tenant"),
|
|
739
785
|
)
|
|
740
786
|
tenant = DynamicModelChoiceField(
|
|
741
787
|
queryset=Tenant.objects.all(),
|
|
742
788
|
required=False,
|
|
789
|
+
label=_("Tenant"),
|
|
743
790
|
)
|
|
744
791
|
|
|
745
792
|
model = Zone
|
|
@@ -751,7 +798,7 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
751
798
|
"nameservers",
|
|
752
799
|
"default_ttl",
|
|
753
800
|
"description",
|
|
754
|
-
name="Attributes",
|
|
801
|
+
name=_("Attributes"),
|
|
755
802
|
),
|
|
756
803
|
FieldSet(
|
|
757
804
|
"soa_ttl",
|
|
@@ -763,12 +810,12 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
763
810
|
"soa_minimum",
|
|
764
811
|
"soa_serial_auto",
|
|
765
812
|
"soa_serial",
|
|
766
|
-
name="SOA",
|
|
813
|
+
name=_("SOA"),
|
|
767
814
|
),
|
|
768
815
|
FieldSet(
|
|
769
816
|
"rfc2317_prefix",
|
|
770
817
|
"rfc2317_parent_managed",
|
|
771
|
-
name="
|
|
818
|
+
name=_("RFC2317"),
|
|
772
819
|
),
|
|
773
820
|
FieldSet(
|
|
774
821
|
"registrar",
|
|
@@ -777,9 +824,9 @@ class ZoneBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
777
824
|
"admin_c",
|
|
778
825
|
"tech_c",
|
|
779
826
|
"billing_c",
|
|
780
|
-
name="Domain Registration",
|
|
827
|
+
name=_("Domain Registration"),
|
|
781
828
|
),
|
|
782
|
-
FieldSet("tenant_group", "tenant", name="Tenancy"),
|
|
829
|
+
FieldSet("tenant_group", "tenant", name=_("Tenancy")),
|
|
783
830
|
)
|
|
784
831
|
|
|
785
832
|
nullable_fields = (
|