netbox-plugin-dns 1.2.11__py3-none-any.whl → 1.3.0__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 (82) hide show
  1. netbox_dns/__init__.py +2 -2
  2. netbox_dns/api/nested_serializers.py +54 -49
  3. netbox_dns/api/serializers_/dnssec_key_template.py +22 -13
  4. netbox_dns/api/serializers_/dnssec_policy.py +89 -40
  5. netbox_dns/api/serializers_/nameserver.py +25 -13
  6. netbox_dns/api/serializers_/record.py +45 -37
  7. netbox_dns/api/serializers_/record_template.py +21 -12
  8. netbox_dns/api/serializers_/registrar.py +14 -5
  9. netbox_dns/api/serializers_/registration_contact.py +13 -5
  10. netbox_dns/api/serializers_/view.py +28 -19
  11. netbox_dns/api/serializers_/zone.py +87 -63
  12. netbox_dns/api/serializers_/zone_template.py +40 -34
  13. netbox_dns/choices/dnssec_key_template.py +4 -0
  14. netbox_dns/filtersets/dnssec_key_template.py +10 -4
  15. netbox_dns/filtersets/dnssec_policy.py +1 -0
  16. netbox_dns/filtersets/nameserver.py +9 -4
  17. netbox_dns/filtersets/record.py +14 -13
  18. netbox_dns/filtersets/record_template.py +13 -12
  19. netbox_dns/filtersets/registrar.py +1 -0
  20. netbox_dns/filtersets/registration_contact.py +1 -0
  21. netbox_dns/filtersets/view.py +10 -4
  22. netbox_dns/filtersets/zone.py +22 -21
  23. netbox_dns/filtersets/zone_template.py +10 -9
  24. netbox_dns/forms/dnssec_key_template.py +97 -46
  25. netbox_dns/forms/dnssec_policy.py +130 -110
  26. netbox_dns/forms/nameserver.py +71 -36
  27. netbox_dns/forms/record.py +96 -78
  28. netbox_dns/forms/record_template.py +87 -59
  29. netbox_dns/forms/registrar.py +55 -39
  30. netbox_dns/forms/registration_contact.py +64 -41
  31. netbox_dns/forms/view.py +98 -51
  32. netbox_dns/forms/zone.py +259 -250
  33. netbox_dns/forms/zone_template.py +151 -101
  34. netbox_dns/graphql/enums.py +41 -0
  35. netbox_dns/graphql/filter_lookups.py +13 -0
  36. netbox_dns/graphql/filters/__init__.py +12 -0
  37. netbox_dns/graphql/filters/dnssec_key_template.py +63 -0
  38. netbox_dns/graphql/filters/dnssec_policy.py +123 -0
  39. netbox_dns/graphql/filters/nameserver.py +32 -0
  40. netbox_dns/graphql/filters/record.py +89 -0
  41. netbox_dns/graphql/filters/record_template.py +55 -0
  42. netbox_dns/graphql/filters/registrar.py +30 -0
  43. netbox_dns/graphql/filters/registration_contact.py +27 -0
  44. netbox_dns/graphql/filters/view.py +28 -0
  45. netbox_dns/graphql/filters/zone.py +146 -0
  46. netbox_dns/graphql/filters/zone_template.py +97 -0
  47. netbox_dns/models/dnssec_key_template.py +24 -27
  48. netbox_dns/models/dnssec_policy.py +17 -21
  49. netbox_dns/models/nameserver.py +26 -30
  50. netbox_dns/models/record.py +42 -46
  51. netbox_dns/models/record_template.py +30 -34
  52. netbox_dns/models/registrar.py +13 -17
  53. netbox_dns/models/registration_contact.py +33 -37
  54. netbox_dns/models/view.py +16 -20
  55. netbox_dns/models/zone.py +75 -78
  56. netbox_dns/models/zone_template.py +35 -39
  57. netbox_dns/tables/dnssec_key_template.py +13 -12
  58. netbox_dns/tables/dnssec_policy.py +18 -15
  59. netbox_dns/tables/nameserver.py +10 -8
  60. netbox_dns/tables/record.py +29 -21
  61. netbox_dns/tables/record_template.py +21 -17
  62. netbox_dns/tables/registrar.py +15 -9
  63. netbox_dns/tables/registration_contact.py +15 -9
  64. netbox_dns/tables/view.py +24 -12
  65. netbox_dns/tables/zone.py +23 -21
  66. netbox_dns/tables/zone_template.py +17 -13
  67. netbox_dns/views/dnssec_key_template.py +0 -9
  68. netbox_dns/views/dnssec_policy.py +0 -9
  69. netbox_dns/views/nameserver.py +0 -9
  70. netbox_dns/views/record.py +0 -9
  71. netbox_dns/views/record_template.py +0 -3
  72. netbox_dns/views/registrar.py +0 -3
  73. netbox_dns/views/registration_contact.py +0 -3
  74. netbox_dns/views/view.py +0 -9
  75. netbox_dns/views/zone.py +0 -10
  76. netbox_dns/views/zone_template.py +0 -4
  77. {netbox_plugin_dns-1.2.11.dist-info → netbox_plugin_dns-1.3.0.dist-info}/METADATA +4 -2
  78. {netbox_plugin_dns-1.2.11.dist-info → netbox_plugin_dns-1.3.0.dist-info}/RECORD +81 -69
  79. netbox_dns/graphql/filters.py +0 -88
  80. {netbox_plugin_dns-1.2.11.dist-info → netbox_plugin_dns-1.3.0.dist-info}/WHEEL +0 -0
  81. {netbox_plugin_dns-1.2.11.dist-info → netbox_plugin_dns-1.3.0.dist-info}/licenses/LICENSE +0 -0
  82. {netbox_plugin_dns-1.2.11.dist-info → netbox_plugin_dns-1.3.0.dist-info}/top_level.txt +0 -0
netbox_dns/forms/view.py CHANGED
@@ -95,6 +95,42 @@ class ViewPrefixUpdateMixin:
95
95
 
96
96
 
97
97
  class ViewForm(ViewPrefixUpdateMixin, TenancyForm, NetBoxModelForm):
98
+ class Meta:
99
+ model = View
100
+
101
+ fields = (
102
+ "name",
103
+ "default_view",
104
+ "description",
105
+ "prefixes",
106
+ "ip_address_filter",
107
+ "tenant_group",
108
+ "tenant",
109
+ "tags",
110
+ )
111
+
112
+ fieldsets = (
113
+ FieldSet(
114
+ "name",
115
+ "default_view",
116
+ "description",
117
+ name=_("View"),
118
+ ),
119
+ FieldSet(
120
+ "prefixes",
121
+ "ip_address_filter",
122
+ ),
123
+ FieldSet(
124
+ "tenant_group",
125
+ "tenant",
126
+ name=_("Tenancy"),
127
+ ),
128
+ FieldSet(
129
+ "tags",
130
+ name=_("Tags"),
131
+ ),
132
+ )
133
+
98
134
  def __init__(self, *args, **kwargs):
99
135
  super().__init__(*args, **kwargs)
100
136
 
@@ -125,26 +161,6 @@ class ViewForm(ViewPrefixUpdateMixin, TenancyForm, NetBoxModelForm):
125
161
  label=_("IP Address Filter"),
126
162
  )
127
163
 
128
- fieldsets = (
129
- FieldSet("name", "default_view", "description", name=_("View")),
130
- FieldSet("prefixes", "ip_address_filter"),
131
- FieldSet("tenant_group", "tenant", name=_("Tenancy")),
132
- FieldSet("tags", name=_("Tags")),
133
- )
134
-
135
- class Meta:
136
- model = View
137
- fields = (
138
- "name",
139
- "default_view",
140
- "description",
141
- "prefixes",
142
- "ip_address_filter",
143
- "tenant_group",
144
- "tenant",
145
- "tags",
146
- )
147
-
148
164
  def clean_prefixes(self):
149
165
  if hasattr(self, "_saved_prefixes"):
150
166
  return self._saved_prefixes
@@ -166,20 +182,36 @@ class ViewForm(ViewPrefixUpdateMixin, TenancyForm, NetBoxModelForm):
166
182
 
167
183
 
168
184
  class ViewFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
185
+ model = View
186
+
187
+ fieldsets = (
188
+ FieldSet(
189
+ "q",
190
+ "filter_id",
191
+ "tag",
192
+ ),
193
+ FieldSet(
194
+ "name",
195
+ "default_view",
196
+ "description",
197
+ name=_("Attributes"),
198
+ ),
199
+ FieldSet(
200
+ "prefix_id",
201
+ ),
202
+ FieldSet(
203
+ "tenant_group_id",
204
+ "tenant_id",
205
+ name=_("Tenancy"),
206
+ ),
207
+ )
208
+
169
209
  def __init__(self, *args, **kwargs):
170
210
  super().__init__(*args, **kwargs)
171
211
 
172
212
  if settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
173
213
  del self.fields["prefix_id"]
174
214
 
175
- model = View
176
- fieldsets = (
177
- FieldSet("q", "filter_id", "tag"),
178
- FieldSet("name", "default_view", "description", name=_("Attributes")),
179
- FieldSet("prefix_id"),
180
- FieldSet("tenant_group_id", "tenant_id", name=_("Tenancy")),
181
- )
182
-
183
215
  name = forms.CharField(
184
216
  required=False,
185
217
  )
@@ -202,6 +234,17 @@ class ViewFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
202
234
 
203
235
 
204
236
  class ViewImportForm(ViewPrefixUpdateMixin, NetBoxModelImportForm):
237
+ class Meta:
238
+ model = View
239
+
240
+ fields = (
241
+ "name",
242
+ "description",
243
+ "prefixes",
244
+ "tenant",
245
+ "tags",
246
+ )
247
+
205
248
  def __init__(self, *args, **kwargs):
206
249
  super().__init__(*args, **kwargs)
207
250
 
@@ -222,14 +265,27 @@ class ViewImportForm(ViewPrefixUpdateMixin, NetBoxModelImportForm):
222
265
  label=_("Tenant"),
223
266
  )
224
267
 
225
- class Meta:
226
- model = View
227
- fields = ("name", "description", "prefixes", "tenant", "tags")
228
-
229
268
 
230
269
  class ViewBulkEditForm(NetBoxModelBulkEditForm):
231
270
  model = View
232
271
 
272
+ fieldsets = (
273
+ FieldSet(
274
+ "description",
275
+ name=_("Attributes"),
276
+ ),
277
+ FieldSet(
278
+ "tenant_group",
279
+ "tenant",
280
+ name=_("Tenancy"),
281
+ ),
282
+ )
283
+
284
+ nullable_fields = (
285
+ "description",
286
+ "tenant",
287
+ )
288
+
233
289
  description = forms.CharField(
234
290
  max_length=200,
235
291
  required=False,
@@ -246,29 +302,11 @@ class ViewBulkEditForm(NetBoxModelBulkEditForm):
246
302
  label=_("Tenant"),
247
303
  )
248
304
 
249
- fieldsets = (
250
- FieldSet(
251
- "description",
252
- name=_("Attributes"),
253
- ),
254
- FieldSet("tenant_group", "tenant", name=_("Tenancy")),
255
- )
256
-
257
- nullable_fields = ("description", "tenant")
258
-
259
305
 
260
306
  class ViewPrefixEditForm(forms.ModelForm):
261
- views = DynamicModelMultipleChoiceField(
262
- queryset=View.objects.all(),
263
- required=False,
264
- help_text=_(
265
- "Explicitly assigning DNS views overrides all inherited views for this prefix"
266
- ),
267
- label=_("Assigned DNS Views"),
268
- )
269
-
270
307
  class Meta:
271
308
  model = Prefix
309
+
272
310
  fields = ("views",)
273
311
 
274
312
  def __init__(self, *args, **kwargs):
@@ -286,6 +324,15 @@ class ViewPrefixEditForm(forms.ModelForm):
286
324
  "You do not have permission to modify assigned views"
287
325
  )
288
326
 
327
+ views = DynamicModelMultipleChoiceField(
328
+ queryset=View.objects.all(),
329
+ required=False,
330
+ help_text=_(
331
+ "Explicitly assigning DNS views overrides all inherited views for this prefix"
332
+ ),
333
+ label=_("Assigned DNS Views"),
334
+ )
335
+
289
336
  def clean(self, *args, **kwargs):
290
337
  if self._permission_denied:
291
338
  return