netbox-plugin-dns 1.1.1__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.

Files changed (88) hide show
  1. netbox_dns/__init__.py +8 -6
  2. netbox_dns/api/nested_serializers.py +3 -2
  3. netbox_dns/api/serializers_/nameserver.py +2 -1
  4. netbox_dns/api/serializers_/record.py +5 -4
  5. netbox_dns/api/serializers_/record_template.py +2 -1
  6. netbox_dns/api/serializers_/view.py +3 -1
  7. netbox_dns/api/serializers_/zone.py +12 -11
  8. netbox_dns/api/serializers_/zone_template.py +8 -7
  9. netbox_dns/api/views.py +9 -4
  10. netbox_dns/choices/record.py +4 -2
  11. netbox_dns/choices/zone.py +6 -4
  12. netbox_dns/fields/address.py +2 -1
  13. netbox_dns/fields/network.py +2 -1
  14. netbox_dns/fields/rfc2317.py +7 -3
  15. netbox_dns/filtersets/nameserver.py +3 -2
  16. netbox_dns/filtersets/record.py +10 -9
  17. netbox_dns/filtersets/record_template.py +3 -2
  18. netbox_dns/filtersets/view.py +3 -2
  19. netbox_dns/filtersets/zone.py +24 -22
  20. netbox_dns/filtersets/zone_template.py +15 -14
  21. netbox_dns/forms/nameserver.py +41 -17
  22. netbox_dns/forms/record.py +43 -26
  23. netbox_dns/forms/record_template.py +49 -28
  24. netbox_dns/forms/registrar.py +21 -17
  25. netbox_dns/forms/registration_contact.py +37 -25
  26. netbox_dns/forms/view.py +75 -34
  27. netbox_dns/forms/zone.py +167 -120
  28. netbox_dns/forms/zone_template.py +53 -43
  29. netbox_dns/graphql/schema.py +0 -10
  30. netbox_dns/graphql/types.py +1 -0
  31. netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  32. netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  33. netbox_dns/management/commands/rebuild_dnssync.py +14 -1
  34. netbox_dns/migrations/0010_view_ip_address_filter.py +18 -0
  35. netbox_dns/mixins/object_modification.py +30 -8
  36. netbox_dns/models/nameserver.py +6 -2
  37. netbox_dns/models/record.py +95 -40
  38. netbox_dns/models/record_template.py +16 -8
  39. netbox_dns/models/registrar.py +11 -7
  40. netbox_dns/models/registration_contact.py +23 -11
  41. netbox_dns/models/view.py +54 -5
  42. netbox_dns/models/zone.py +77 -50
  43. netbox_dns/models/zone_template.py +12 -10
  44. netbox_dns/navigation.py +30 -28
  45. netbox_dns/signals/ipam_dnssync.py +25 -18
  46. netbox_dns/tables/ipam_dnssync.py +2 -1
  47. netbox_dns/tables/nameserver.py +2 -0
  48. netbox_dns/tables/record.py +21 -11
  49. netbox_dns/tables/record_template.py +12 -5
  50. netbox_dns/tables/registrar.py +2 -0
  51. netbox_dns/tables/registration_contact.py +2 -0
  52. netbox_dns/tables/view.py +4 -2
  53. netbox_dns/tables/zone.py +15 -2
  54. netbox_dns/tables/zone_template.py +7 -0
  55. netbox_dns/templates/netbox_dns/nameserver.html +6 -5
  56. netbox_dns/templates/netbox_dns/record/managed.html +2 -1
  57. netbox_dns/templates/netbox_dns/record/related.html +26 -14
  58. netbox_dns/templates/netbox_dns/record.html +39 -20
  59. netbox_dns/templates/netbox_dns/recordtemplate.html +27 -15
  60. netbox_dns/templates/netbox_dns/registrar.html +11 -10
  61. netbox_dns/templates/netbox_dns/registrationcontact.html +16 -15
  62. netbox_dns/templates/netbox_dns/view/button.html +2 -1
  63. netbox_dns/templates/netbox_dns/view/prefix.html +7 -4
  64. netbox_dns/templates/netbox_dns/view/related.html +26 -10
  65. netbox_dns/templates/netbox_dns/view.html +22 -9
  66. netbox_dns/templates/netbox_dns/zone/base.html +2 -1
  67. netbox_dns/templates/netbox_dns/zone/child.html +3 -2
  68. netbox_dns/templates/netbox_dns/zone/record.html +3 -2
  69. netbox_dns/templates/netbox_dns/zone/registration.html +8 -7
  70. netbox_dns/templates/netbox_dns/zone.html +28 -30
  71. netbox_dns/templates/netbox_dns/zonetemplate.html +27 -17
  72. netbox_dns/utilities/ipam_dnssync.py +71 -28
  73. netbox_dns/validators/dns_name.py +11 -4
  74. netbox_dns/validators/dns_value.py +9 -4
  75. netbox_dns/validators/rfc2317.py +6 -3
  76. netbox_dns/views/nameserver.py +4 -2
  77. netbox_dns/views/record_template.py +4 -3
  78. netbox_dns/views/registrar.py +3 -1
  79. netbox_dns/views/registration_contact.py +2 -1
  80. netbox_dns/views/view.py +2 -1
  81. netbox_dns/views/zone.py +6 -4
  82. netbox_dns/views/zone_template.py +8 -7
  83. {netbox_plugin_dns-1.1.1.dist-info → netbox_plugin_dns-1.1.3.dist-info}/METADATA +1 -1
  84. netbox_plugin_dns-1.1.3.dist-info/RECORD +150 -0
  85. {netbox_plugin_dns-1.1.1.dist-info → netbox_plugin_dns-1.1.3.dist-info}/WHEEL +1 -1
  86. netbox_plugin_dns-1.1.1.dist-info/RECORD +0 -147
  87. {netbox_plugin_dns-1.1.1.dist-info → netbox_plugin_dns-1.1.3.dist-info}/LICENSE +0 -0
  88. {netbox_plugin_dns-1.1.1.dist-info → netbox_plugin_dns-1.1.3.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  from django import forms
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.forms import (
4
5
  NetBoxModelBulkEditForm,
@@ -16,7 +17,7 @@ from utilities.forms.fields import (
16
17
  from utilities.forms.widgets import BulkEditNullBooleanSelect
17
18
  from utilities.forms import add_blank_choice
18
19
  from utilities.forms.rendering import FieldSet
19
- from tenancy.models import Tenant
20
+ from tenancy.models import Tenant, TenantGroup
20
21
  from tenancy.forms import TenancyForm, TenancyFilterForm
21
22
 
22
23
  from netbox_dns.models import RecordTemplate, ZoneTemplate
@@ -41,12 +42,12 @@ class RecordTemplateForm(TenancyForm, NetBoxModelForm):
41
42
  self.initial["record_name"] = name_to_unicode(initial_record_name)
42
43
 
43
44
  disable_ptr = forms.BooleanField(
44
- label="Disable PTR",
45
45
  required=False,
46
+ label=_("Disable PTR"),
46
47
  )
47
48
  ttl = forms.IntegerField(
48
49
  required=False,
49
- label="TTL",
50
+ label=_("TTL"),
50
51
  )
51
52
 
52
53
  fieldsets = (
@@ -59,10 +60,10 @@ class RecordTemplateForm(TenancyForm, NetBoxModelForm):
59
60
  "ttl",
60
61
  "disable_ptr",
61
62
  "description",
62
- name="Record Template",
63
+ name=_("Record Template"),
63
64
  ),
64
- FieldSet("tenant_group", "tenant", name="Tenancy"),
65
- FieldSet("tags", name="Tags"),
65
+ FieldSet("tenant_group", "tenant", name=_("Tenancy")),
66
+ FieldSet("tags", name=_("Tags")),
66
67
  )
67
68
 
68
69
  class Meta:
@@ -77,8 +78,9 @@ class RecordTemplateForm(TenancyForm, NetBoxModelForm):
77
78
  "ttl",
78
79
  "disable_ptr",
79
80
  "description",
80
- "tags",
81
+ "tenant_group",
81
82
  "tenant",
83
+ "tags",
82
84
  )
83
85
 
84
86
 
@@ -93,44 +95,47 @@ class RecordTemplateFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
93
95
  "value",
94
96
  "status",
95
97
  "disable_ptr",
96
- "status",
97
98
  "description",
98
- name="Attributes",
99
+ name=_("Attributes"),
99
100
  ),
100
- FieldSet("zone_template_id", name="Zone Templates"),
101
- FieldSet("tenant_group_id", "tenant_id", name="Tenancy"),
101
+ FieldSet("zone_template_id", name=_("Zone Templates")),
102
+ FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
102
103
  )
103
104
 
104
105
  type = forms.MultipleChoiceField(
105
106
  choices=RecordTypeChoices,
106
107
  required=False,
108
+ label=_("Type"),
107
109
  )
108
110
  name = forms.CharField(
109
111
  required=False,
110
- label="Template name",
112
+ label=_("Template Name"),
111
113
  )
112
114
  record_name = forms.CharField(
113
115
  required=False,
114
- label="Name",
116
+ label=_("Name"),
115
117
  )
116
118
  value = forms.CharField(
117
119
  required=False,
120
+ label=_("Value"),
118
121
  )
119
122
  status = forms.MultipleChoiceField(
120
123
  choices=RecordStatusChoices,
121
124
  required=False,
125
+ label=_("Status"),
122
126
  )
123
127
  disable_ptr = forms.NullBooleanField(
124
128
  required=False,
125
- label="Disable PTR",
129
+ label=_("Disable PTR"),
126
130
  )
127
131
  description = forms.CharField(
128
132
  required=False,
133
+ label=_("Description"),
129
134
  )
130
135
  zone_template_id = DynamicModelMultipleChoiceField(
131
136
  queryset=ZoneTemplate.objects.all(),
132
137
  required=False,
133
- label="Zone templates",
138
+ label=_("Zone Templates"),
134
139
  )
135
140
  tag = TagFilterField(RecordTemplate)
136
141
 
@@ -139,27 +144,26 @@ class RecordTemplateImportForm(NetBoxModelImportForm):
139
144
  type = CSVChoiceField(
140
145
  choices=RecordTypeChoices,
141
146
  required=True,
142
- help_text="Record Type",
147
+ label=_("Type"),
143
148
  )
144
149
  status = CSVChoiceField(
145
150
  choices=RecordStatusChoices,
146
151
  required=False,
147
- help_text="Record status",
152
+ label=_("Status"),
148
153
  )
149
154
  ttl = forms.IntegerField(
150
155
  required=False,
151
- help_text="TTL",
156
+ label=_("TTL"),
152
157
  )
153
158
  disable_ptr = forms.BooleanField(
154
159
  required=False,
155
- label="Disable PTR",
156
- help_text="Disable generation of a PTR record",
160
+ label=_("Disable PTR"),
157
161
  )
158
162
  tenant = CSVModelChoiceField(
159
163
  queryset=Tenant.objects.all(),
160
164
  to_field_name="name",
161
165
  required=False,
162
- help_text="Assigned tenant",
166
+ label=_("Tenant"),
163
167
  )
164
168
 
165
169
  class Meta:
@@ -185,24 +189,41 @@ class RecordTemplateBulkEditForm(NetBoxModelBulkEditForm):
185
189
  type = forms.ChoiceField(
186
190
  choices=add_blank_choice(RecordTypeChoices),
187
191
  required=False,
192
+ label=_("Type"),
188
193
  )
189
194
  value = forms.CharField(
190
195
  required=False,
191
- label="Value",
196
+ label=_("Value"),
192
197
  )
193
198
  status = forms.ChoiceField(
194
199
  choices=add_blank_choice(RecordStatusChoices),
195
200
  required=False,
201
+ label=_("Status"),
196
202
  )
197
203
  ttl = forms.IntegerField(
198
204
  required=False,
199
- label="TTL",
205
+ label=_("TTL"),
200
206
  )
201
207
  disable_ptr = forms.NullBooleanField(
202
- required=False, widget=BulkEditNullBooleanSelect(), label="Disable PTR"
208
+ required=False,
209
+ widget=BulkEditNullBooleanSelect(),
210
+ label=_("Disable PTR"),
211
+ )
212
+ description = forms.CharField(
213
+ max_length=200,
214
+ required=False,
215
+ label=_("Description"),
216
+ )
217
+ tenant_group = DynamicModelChoiceField(
218
+ queryset=TenantGroup.objects.all(),
219
+ required=False,
220
+ label=_("Tenant Group"),
221
+ )
222
+ tenant = DynamicModelChoiceField(
223
+ queryset=Tenant.objects.all(),
224
+ required=False,
225
+ label=_("Tenant"),
203
226
  )
204
- description = forms.CharField(max_length=200, required=False)
205
- tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
206
227
 
207
228
  fieldsets = (
208
229
  FieldSet(
@@ -213,8 +234,8 @@ class RecordTemplateBulkEditForm(NetBoxModelBulkEditForm):
213
234
  "ttl",
214
235
  "disable_ptr",
215
236
  "description",
216
- name="Attributes",
237
+ name=_("Attributes"),
217
238
  ),
218
- FieldSet("tenant_group", "tenant", name="Tenancy"),
239
+ FieldSet("tenant_group", "tenant", name=_("Tenancy")),
219
240
  )
220
241
  nullable_fields = ("description", "ttl", "tenant")
@@ -1,4 +1,5 @@
1
1
  from django import forms
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.forms import (
4
5
  NetBoxModelBulkEditForm,
@@ -33,9 +34,9 @@ class RegistrarForm(NetBoxModelForm):
33
34
  "whois_server",
34
35
  "abuse_email",
35
36
  "abuse_phone",
36
- name="Registrar",
37
+ name=_("Registrar"),
37
38
  ),
38
- FieldSet("tags", name="Tags"),
39
+ FieldSet("tags", name=_("Tags")),
39
40
  )
40
41
  fields = (
41
42
  "name",
@@ -54,45 +55,48 @@ class RegistrarFilterForm(NetBoxModelFilterSetForm):
54
55
  model = Registrar
55
56
  fieldsets = (
56
57
  FieldSet("q", "filter_id", "tag"),
57
- FieldSet("name", "iana_id", "description", name="Attributes"),
58
+ FieldSet("name", "iana_id", "description", name=_("Attributes")),
58
59
  FieldSet(
59
60
  "address",
60
61
  "referral_url",
61
62
  "whois_server",
62
63
  "abuse_email",
63
64
  "abuse_phone",
64
- name="Contact",
65
+ name=_("Contact"),
65
66
  ),
66
67
  )
67
68
 
68
69
  name = forms.CharField(
69
70
  required=False,
71
+ label=_("Name"),
70
72
  )
71
73
  address = forms.CharField(
72
74
  required=False,
75
+ label=_("Address"),
73
76
  )
74
77
  description = forms.CharField(
75
78
  required=False,
79
+ label=_("Description"),
76
80
  )
77
81
  iana_id = forms.IntegerField(
78
82
  required=False,
79
- label="IANA ID",
83
+ label=_("IANA ID"),
80
84
  )
81
85
  referral_url = forms.CharField(
82
86
  required=False,
83
- label="Referral URL",
87
+ label=_("Referral URL"),
84
88
  )
85
89
  whois_server = forms.CharField(
86
90
  required=False,
87
- label="WHOIS Server",
91
+ label=_("WHOIS Server"),
88
92
  )
89
93
  abuse_email = forms.CharField(
90
94
  required=False,
91
- label="Abuse Email",
95
+ label=_("Abuse Email"),
92
96
  )
93
97
  abuse_phone = forms.CharField(
94
98
  required=False,
95
- label="Abuse Phone",
99
+ label=_("Abuse Phone"),
96
100
  )
97
101
  tag = TagFilterField(Registrar)
98
102
 
@@ -118,31 +122,31 @@ class RegistrarBulkEditForm(NetBoxModelBulkEditForm):
118
122
 
119
123
  iana_id = forms.IntegerField(
120
124
  required=False,
121
- label="IANA ID",
125
+ label=_("IANA ID"),
122
126
  )
123
127
  description = forms.CharField(
124
128
  required=False,
125
- label="Description",
129
+ label=_("Description"),
126
130
  )
127
131
  address = forms.CharField(
128
132
  required=False,
129
- label="Address",
133
+ label=_("Address"),
130
134
  )
131
135
  referral_url = forms.CharField(
132
136
  required=False,
133
- label="Referral URL",
137
+ label=_("Referral URL"),
134
138
  )
135
139
  whois_server = forms.CharField(
136
140
  required=False,
137
- label="WHOIS Server",
141
+ label=_("WHOIS Server"),
138
142
  )
139
143
  abuse_email = forms.CharField(
140
144
  required=False,
141
- label="Abuse Email",
145
+ label=_("Abuse Email"),
142
146
  )
143
147
  abuse_phone = forms.CharField(
144
148
  required=False,
145
- label="Abuse Phone",
149
+ label=_("Abuse Phone"),
146
150
  )
147
151
 
148
152
  fieldsets = (
@@ -154,7 +158,7 @@ class RegistrarBulkEditForm(NetBoxModelBulkEditForm):
154
158
  "whois_server",
155
159
  "abuse_email",
156
160
  "abuse_phone",
157
- name="Attributes",
161
+ name=_("Attributes"),
158
162
  ),
159
163
  )
160
164
 
@@ -1,4 +1,5 @@
1
1
  from django import forms
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.forms import (
4
5
  NetBoxModelBulkEditForm,
@@ -37,7 +38,7 @@ class RegistrationContactForm(NetBoxModelForm):
37
38
  "fax",
38
39
  "fax_ext",
39
40
  "email",
40
- name="RegistrationContact",
41
+ name=_("Contact"),
41
42
  ),
42
43
  FieldSet("tags", name="Tags"),
43
44
  )
@@ -68,7 +69,7 @@ class RegistrationContactFilterForm(NetBoxModelFilterSetForm):
68
69
 
69
70
  fieldsets = (
70
71
  FieldSet("q", "filter_id", "tag"),
71
- FieldSet("name", "contact_id", "description", name="Attributes"),
72
+ FieldSet("name", "contact_id", "description", name=_("Attributes")),
72
73
  FieldSet(
73
74
  "organization",
74
75
  "street",
@@ -76,57 +77,68 @@ class RegistrationContactFilterForm(NetBoxModelFilterSetForm):
76
77
  "state_province",
77
78
  "postal_code",
78
79
  "country",
79
- name="Address",
80
+ name=_("Address"),
81
+ ),
82
+ FieldSet(
83
+ "phone", "phone_ext", "fax", "fax_ext", "email", name=_("Communication")
80
84
  ),
81
- FieldSet("phone", "phone_ext", "fax", "fax_ext", "email", name="Communication"),
82
85
  )
83
86
 
84
87
  name = forms.CharField(
85
88
  required=False,
89
+ label=_("Name"),
86
90
  )
87
91
  description = forms.CharField(
88
92
  required=False,
93
+ label=_("Description"),
89
94
  )
90
95
  contact_id = forms.CharField(
91
96
  required=False,
92
- label="RegistrationContact ID",
97
+ label=_("Contact ID"),
93
98
  )
94
99
  organization = forms.CharField(
95
100
  required=False,
101
+ label=_("Organization"),
96
102
  )
97
103
  street = forms.CharField(
98
104
  required=False,
105
+ label=_("Street"),
99
106
  )
100
107
  city = forms.CharField(
101
108
  required=False,
109
+ label=_("City"),
102
110
  )
103
111
  state_province = forms.CharField(
104
112
  required=False,
105
- label="State/Province",
113
+ label=_("State/Province"),
106
114
  )
107
115
  postal_code = forms.CharField(
108
116
  required=False,
109
- label="Postal Code",
117
+ label=_("Postal Code"),
110
118
  )
111
119
  country = forms.CharField(
112
120
  required=False,
121
+ label=_("Country"),
113
122
  )
114
123
  phone = forms.CharField(
115
124
  required=False,
125
+ label=_("Phone"),
116
126
  )
117
127
  phone_ext = forms.CharField(
118
128
  required=False,
119
- label="Phone Extension",
129
+ label=_("Phone Extension"),
120
130
  )
121
131
  fax = forms.CharField(
122
132
  required=False,
133
+ label=_("Fax"),
123
134
  )
124
135
  fax_ext = forms.CharField(
125
136
  required=False,
126
- label="Fax Extension",
137
+ label=_("Fax Extension"),
127
138
  )
128
139
  email = forms.CharField(
129
140
  required=False,
141
+ label=_("Email Address"),
130
142
  )
131
143
  tag = TagFilterField(RegistrationContact)
132
144
 
@@ -158,59 +170,59 @@ class RegistrationContactBulkEditForm(NetBoxModelBulkEditForm):
158
170
 
159
171
  name = forms.CharField(
160
172
  required=False,
161
- label="Name",
173
+ label=_("Name"),
162
174
  )
163
175
  description = forms.CharField(
164
176
  required=False,
165
- label="Description",
177
+ label=_("Description"),
166
178
  )
167
179
  organization = forms.CharField(
168
180
  required=False,
169
- label="Organization",
181
+ label=_("Organization"),
170
182
  )
171
183
  street = forms.CharField(
172
184
  required=False,
173
- label="Street",
185
+ label=_("Street"),
174
186
  )
175
187
  city = forms.CharField(
176
188
  required=False,
177
- label="City",
189
+ label=_("City"),
178
190
  )
179
191
  state_province = forms.CharField(
180
192
  required=False,
181
- label="State/Province",
193
+ label=_("State/Province"),
182
194
  )
183
195
  postal_code = forms.CharField(
184
196
  required=False,
185
- label="Postal Code",
197
+ label=_("Postal Code"),
186
198
  )
187
199
  country = forms.CharField(
188
200
  required=False,
189
- label="Country",
201
+ label=_("Country"),
190
202
  )
191
203
  phone = forms.CharField(
192
204
  required=False,
193
- label="Phone",
205
+ label=_("Phone"),
194
206
  )
195
207
  phone_ext = forms.CharField(
196
208
  required=False,
197
- label="Phone Extension",
209
+ label=_("Phone Extension"),
198
210
  )
199
211
  fax = forms.CharField(
200
212
  required=False,
201
- label="Fax",
213
+ label=_("Fax"),
202
214
  )
203
215
  fax_ext = forms.CharField(
204
216
  required=False,
205
- label="Fax Extension",
217
+ label=_("Fax Extension"),
206
218
  )
207
219
  email = forms.CharField(
208
220
  required=False,
209
- label="Email Address",
221
+ label=_("Email Address"),
210
222
  )
211
223
 
212
224
  fieldsets = (
213
- FieldSet("name", "description", name="Attributes"),
225
+ FieldSet("name", "description", name=_("Attributes")),
214
226
  FieldSet(
215
227
  "organization",
216
228
  "street",
@@ -218,7 +230,7 @@ class RegistrationContactBulkEditForm(NetBoxModelBulkEditForm):
218
230
  "state_province",
219
231
  "postal_code",
220
232
  "country",
221
- name="Address",
233
+ name=_("Address"),
222
234
  ),
223
235
  FieldSet(
224
236
  "phone",
@@ -226,7 +238,7 @@ class RegistrationContactBulkEditForm(NetBoxModelBulkEditForm):
226
238
  "fax",
227
239
  "fax_ext",
228
240
  "email",
229
- name="Communication",
241
+ name=_("Communication"),
230
242
  ),
231
243
  )
232
244