netbox-plugin-dns 0.22.9__py3-none-any.whl → 1.0b1__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 (103) hide show
  1. netbox_dns/__init__.py +3 -14
  2. netbox_dns/api/nested_serializers.py +4 -60
  3. netbox_dns/api/serializers.py +8 -314
  4. netbox_dns/api/serializers_/__init__.py +0 -0
  5. netbox_dns/api/serializers_/contact.py +37 -0
  6. netbox_dns/api/serializers_/nameserver.py +39 -0
  7. netbox_dns/api/serializers_/record.py +90 -0
  8. netbox_dns/api/serializers_/registrar.py +31 -0
  9. netbox_dns/api/serializers_/view.py +29 -0
  10. netbox_dns/api/serializers_/zone.py +170 -0
  11. netbox_dns/api/views.py +13 -13
  12. netbox_dns/fields/network.py +1 -1
  13. netbox_dns/fields/rfc2317.py +1 -1
  14. netbox_dns/{filters → filtersets}/contact.py +2 -1
  15. netbox_dns/filtersets/nameserver.py +37 -0
  16. netbox_dns/{filters → filtersets}/record.py +51 -6
  17. netbox_dns/{filters → filtersets}/registrar.py +2 -1
  18. netbox_dns/{filters → filtersets}/view.py +2 -2
  19. netbox_dns/filtersets/zone.py +205 -0
  20. netbox_dns/forms/contact.py +61 -33
  21. netbox_dns/forms/nameserver.py +21 -8
  22. netbox_dns/forms/record.py +35 -36
  23. netbox_dns/forms/registrar.py +45 -15
  24. netbox_dns/forms/view.py +19 -8
  25. netbox_dns/forms/zone.py +112 -87
  26. netbox_dns/graphql/__init__.py +17 -27
  27. netbox_dns/graphql/filters.py +49 -0
  28. netbox_dns/graphql/schema.py +66 -7
  29. netbox_dns/graphql/types.py +146 -0
  30. netbox_dns/management/commands/cleanup_database.py +0 -4
  31. netbox_dns/management/commands/cleanup_rrset_ttl.py +3 -5
  32. netbox_dns/management/commands/setup_coupling.py +15 -15
  33. netbox_dns/management/commands/update_soa.py +1 -1
  34. netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -27
  35. netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +556 -0
  36. netbox_dns/migrations/{0013_add_nameserver_zone_record_description.py → 0002_contact_description_registrar_description.py} +4 -9
  37. netbox_dns/migrations/0020_netbox_3_4.py +1 -1
  38. netbox_dns/models/contact.py +6 -1
  39. netbox_dns/models/nameserver.py +3 -3
  40. netbox_dns/models/record.py +8 -15
  41. netbox_dns/models/registrar.py +5 -1
  42. netbox_dns/models/view.py +1 -1
  43. netbox_dns/models/zone.py +6 -9
  44. netbox_dns/navigation.py +1 -15
  45. netbox_dns/signals/ipam_coupling.py +3 -8
  46. netbox_dns/tables/contact.py +1 -0
  47. netbox_dns/tables/nameserver.py +0 -2
  48. netbox_dns/tables/registrar.py +1 -0
  49. netbox_dns/template_content.py +3 -7
  50. netbox_dns/templates/netbox_dns/contact.html +60 -56
  51. netbox_dns/templates/netbox_dns/nameserver.html +27 -27
  52. netbox_dns/templates/netbox_dns/record.html +92 -94
  53. netbox_dns/templates/netbox_dns/registrar.html +38 -36
  54. netbox_dns/templates/netbox_dns/view.html +21 -21
  55. netbox_dns/templates/netbox_dns/zone/base.html +5 -3
  56. netbox_dns/templates/netbox_dns/zone/child.html +3 -3
  57. netbox_dns/templates/netbox_dns/zone/managed_record.html +1 -1
  58. netbox_dns/templates/netbox_dns/zone/record.html +3 -3
  59. netbox_dns/templates/netbox_dns/zone/registration.html +26 -27
  60. netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +1 -1
  61. netbox_dns/templates/netbox_dns/zone.html +150 -149
  62. netbox_dns/utilities/__init__.py +1 -6
  63. netbox_dns/utilities/ipam_coupling.py +2 -7
  64. netbox_dns/validators/dns_name.py +4 -9
  65. netbox_dns/validators/rfc2317.py +2 -2
  66. netbox_dns/views/contact.py +4 -4
  67. netbox_dns/views/nameserver.py +5 -5
  68. netbox_dns/views/record.py +19 -12
  69. netbox_dns/views/registrar.py +4 -4
  70. netbox_dns/views/view.py +4 -4
  71. netbox_dns/views/zone.py +7 -8
  72. {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/METADATA +5 -7
  73. netbox_plugin_dns-1.0b1.dist-info/RECORD +103 -0
  74. netbox_dns/filters/nameserver.py +0 -18
  75. netbox_dns/filters/zone.py +0 -112
  76. netbox_dns/graphql/contact.py +0 -19
  77. netbox_dns/graphql/nameserver.py +0 -19
  78. netbox_dns/graphql/record.py +0 -19
  79. netbox_dns/graphql/registrar.py +0 -19
  80. netbox_dns/graphql/view.py +0 -19
  81. netbox_dns/graphql/zone.py +0 -19
  82. netbox_dns/migrations/0001_initial.py +0 -115
  83. netbox_dns/migrations/0002_zone_default_ttl.py +0 -18
  84. netbox_dns/migrations/0003_soa_managed_records.py +0 -112
  85. netbox_dns/migrations/0004_create_ptr_for_a_aaaa_records.py +0 -80
  86. netbox_dns/migrations/0005_update_ns_records.py +0 -41
  87. netbox_dns/migrations/0006_zone_soa_serial_auto.py +0 -29
  88. netbox_dns/migrations/0007_alter_zone_soa_serial_auto.py +0 -17
  89. netbox_dns/migrations/0008_zone_status_names.py +0 -21
  90. netbox_dns/migrations/0009_netbox32.py +0 -71
  91. netbox_dns/migrations/0010_update_soa_records.py +0 -58
  92. netbox_dns/migrations/0011_add_view_model.py +0 -70
  93. netbox_dns/migrations/0012_adjust_zone_and_record.py +0 -17
  94. netbox_dns/migrations/0014_add_view_description.py +0 -16
  95. netbox_dns/migrations/0015_add_record_status.py +0 -17
  96. netbox_dns/migrations/0016_cleanup_ptr_records.py +0 -38
  97. netbox_dns/migrations/0017_alter_record_ttl.py +0 -17
  98. netbox_dns/migrations/0018_zone_arpa_network.py +0 -51
  99. netbox_dns/migrations/0019_update_ns_ttl.py +0 -19
  100. netbox_plugin_dns-0.22.9.dist-info/RECORD +0 -117
  101. /netbox_dns/{filters → filtersets}/__init__.py +0 -0
  102. {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/LICENSE +0 -0
  103. {netbox_plugin_dns-0.22.9.dist-info → netbox_plugin_dns-1.0b1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,556 @@
1
+ # Generated by Django 5.0.1 on 2024-02-12 14:49
2
+
3
+ import django.core.validators
4
+ import django.db.models.deletion
5
+ import netbox_dns.fields.address
6
+ import netbox_dns.fields.network
7
+ import netbox_dns.fields.rfc2317
8
+ import taggit.managers
9
+ import utilities.json
10
+ from django.db import migrations, models
11
+
12
+
13
+ from netbox_dns.models import RecordTypeChoices
14
+ from netbox_dns.utilities import arpa_to_prefix
15
+
16
+
17
+ def fqdn(record):
18
+ if record.name == "@":
19
+ return f"{record.zone.name}."
20
+
21
+ return f"{record.name}.{record.zone.name}."
22
+
23
+
24
+ def address_from_name(record):
25
+ prefix = arpa_to_prefix(fqdn(record))
26
+ if prefix is not None:
27
+ return prefix.ip
28
+
29
+ return None
30
+
31
+
32
+ def update_ip_addresses(apps, schema_editor):
33
+ Record = apps.get_model("netbox_dns", "Record")
34
+
35
+ for record in Record.objects.filter(type=RecordTypeChoices.PTR):
36
+ record.ip_address = address_from_name(record)
37
+ record.save()
38
+
39
+ for record in Record.objects.filter(
40
+ type__in=(RecordTypeChoices.A, RecordTypeChoices.AAAA)
41
+ ):
42
+ record.ip_address = record.value
43
+ record.save()
44
+
45
+
46
+ def update_record_fqdn(apps, schema_editor):
47
+ Record = apps.get_model("netbox_dns", "Record")
48
+
49
+ for record in Record.objects.filter(fqdn__isnull=True):
50
+ zone = dns_name.from_text(record.zone.name, origin=dns_name.root)
51
+ fqdn = dns_name.from_text(record.name, origin=zone)
52
+
53
+ record.fqdn = fqdn.to_text()
54
+
55
+ record.save()
56
+
57
+
58
+ class Migration(migrations.Migration):
59
+ replaces = [
60
+ ("netbox_dns", "0001_squashed_netbox_dns_0_15"),
61
+ ("netbox_dns", "0020_netbox_3_4"),
62
+ ("netbox_dns", "0021_record_ip_address"),
63
+ ("netbox_dns", "0022_search"),
64
+ ("netbox_dns", "0023_alter_record_value"),
65
+ ("netbox_dns", "0024_tenancy"),
66
+ ("netbox_dns", "0025_ipam_coupling_cf"),
67
+ ("netbox_dns", "0026_domain_registration"),
68
+ ("netbox_dns", "0027_alter_registrar_iana_id"),
69
+ ("netbox_dns", "0028_rfc2317_fields"),
70
+ ("netbox_dns", "0029_record_fqdn"),
71
+ ]
72
+
73
+ initial = True
74
+
75
+ dependencies = [
76
+ ("extras", "0073_journalentry_tags_custom_fields"),
77
+ ("ipam", "0066_iprange_mark_utilized"),
78
+ ("tenancy", "0010_tenant_relax_uniqueness"),
79
+ ]
80
+
81
+ operations = [
82
+ migrations.CreateModel(
83
+ name="NameServer",
84
+ fields=[
85
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
86
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
87
+ (
88
+ "custom_field_data",
89
+ models.JSONField(
90
+ blank=True,
91
+ default=dict,
92
+ encoder=utilities.json.CustomFieldJSONEncoder,
93
+ ),
94
+ ),
95
+ (
96
+ "id",
97
+ models.BigAutoField(
98
+ auto_created=True, primary_key=True, serialize=False
99
+ ),
100
+ ),
101
+ ("name", models.CharField(max_length=255, unique=True)),
102
+ (
103
+ "tags",
104
+ taggit.managers.TaggableManager(
105
+ through="extras.TaggedItem", to="extras.Tag"
106
+ ),
107
+ ),
108
+ ("description", models.CharField(blank=True, max_length=200)),
109
+ ],
110
+ options={
111
+ "ordering": ("name",),
112
+ },
113
+ ),
114
+ migrations.CreateModel(
115
+ name="View",
116
+ fields=[
117
+ (
118
+ "id",
119
+ models.BigAutoField(
120
+ auto_created=True, primary_key=True, serialize=False
121
+ ),
122
+ ),
123
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
124
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
125
+ (
126
+ "custom_field_data",
127
+ models.JSONField(
128
+ blank=True,
129
+ default=dict,
130
+ encoder=utilities.json.CustomFieldJSONEncoder,
131
+ ),
132
+ ),
133
+ ("name", models.CharField(max_length=255, unique=True)),
134
+ (
135
+ "tags",
136
+ taggit.managers.TaggableManager(
137
+ through="extras.TaggedItem", to="extras.Tag"
138
+ ),
139
+ ),
140
+ ("description", models.CharField(blank=True, max_length=200)),
141
+ ],
142
+ options={
143
+ "ordering": ("name",),
144
+ },
145
+ ),
146
+ migrations.CreateModel(
147
+ name="Zone",
148
+ fields=[
149
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
150
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
151
+ (
152
+ "custom_field_data",
153
+ models.JSONField(
154
+ blank=True,
155
+ default=dict,
156
+ encoder=utilities.json.CustomFieldJSONEncoder,
157
+ ),
158
+ ),
159
+ (
160
+ "id",
161
+ models.BigAutoField(
162
+ auto_created=True, primary_key=True, serialize=False
163
+ ),
164
+ ),
165
+ ("name", models.CharField(max_length=255)),
166
+ (
167
+ "status",
168
+ models.CharField(blank=True, default="active", max_length=50),
169
+ ),
170
+ (
171
+ "nameservers",
172
+ models.ManyToManyField(
173
+ blank=True, related_name="zones", to="netbox_dns.nameserver"
174
+ ),
175
+ ),
176
+ (
177
+ "tags",
178
+ taggit.managers.TaggableManager(
179
+ through="extras.TaggedItem", to="extras.Tag"
180
+ ),
181
+ ),
182
+ ("description", models.CharField(blank=True, max_length=200)),
183
+ (
184
+ "view",
185
+ models.ForeignKey(
186
+ blank=True,
187
+ null=True,
188
+ on_delete=django.db.models.deletion.PROTECT,
189
+ to="netbox_dns.view",
190
+ ),
191
+ ),
192
+ (
193
+ "default_ttl",
194
+ models.PositiveIntegerField(
195
+ blank=True,
196
+ validators=[django.core.validators.MinValueValidator(1)],
197
+ ),
198
+ ),
199
+ (
200
+ "soa_expire",
201
+ models.PositiveIntegerField(
202
+ validators=[django.core.validators.MinValueValidator(1)]
203
+ ),
204
+ ),
205
+ (
206
+ "soa_minimum",
207
+ models.PositiveIntegerField(
208
+ validators=[django.core.validators.MinValueValidator(1)]
209
+ ),
210
+ ),
211
+ (
212
+ "soa_mname",
213
+ models.ForeignKey(
214
+ on_delete=django.db.models.deletion.PROTECT,
215
+ related_name="zones_soa",
216
+ to="netbox_dns.nameserver",
217
+ ),
218
+ ),
219
+ (
220
+ "soa_refresh",
221
+ models.PositiveIntegerField(
222
+ validators=[django.core.validators.MinValueValidator(1)]
223
+ ),
224
+ ),
225
+ (
226
+ "soa_retry",
227
+ models.PositiveIntegerField(
228
+ validators=[django.core.validators.MinValueValidator(1)]
229
+ ),
230
+ ),
231
+ ("soa_rname", models.CharField(max_length=255)),
232
+ (
233
+ "soa_serial",
234
+ models.BigIntegerField(
235
+ blank=True,
236
+ null=True,
237
+ validators=[
238
+ django.core.validators.MinValueValidator(1),
239
+ django.core.validators.MaxValueValidator(4294967295),
240
+ ],
241
+ ),
242
+ ),
243
+ (
244
+ "soa_ttl",
245
+ models.PositiveIntegerField(
246
+ validators=[django.core.validators.MinValueValidator(1)]
247
+ ),
248
+ ),
249
+ ("soa_serial_auto", models.BooleanField(default=True)),
250
+ (
251
+ "arpa_network",
252
+ netbox_dns.fields.network.NetworkField(blank=True, null=True),
253
+ ),
254
+ ],
255
+ options={
256
+ "ordering": ("view", "name"),
257
+ "unique_together": {("view", "name")},
258
+ },
259
+ ),
260
+ migrations.CreateModel(
261
+ name="Record",
262
+ fields=[
263
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
264
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
265
+ (
266
+ "custom_field_data",
267
+ models.JSONField(
268
+ blank=True,
269
+ default=dict,
270
+ encoder=utilities.json.CustomFieldJSONEncoder,
271
+ ),
272
+ ),
273
+ (
274
+ "id",
275
+ models.BigAutoField(
276
+ auto_created=True, primary_key=True, serialize=False
277
+ ),
278
+ ),
279
+ ("type", models.CharField(max_length=10)),
280
+ ("name", models.CharField(max_length=255)),
281
+ ("value", models.CharField(max_length=1000)),
282
+ ("ttl", models.PositiveIntegerField(blank=True, null=True)),
283
+ (
284
+ "tags",
285
+ taggit.managers.TaggableManager(
286
+ through="extras.TaggedItem", to="extras.Tag"
287
+ ),
288
+ ),
289
+ (
290
+ "zone",
291
+ models.ForeignKey(
292
+ on_delete=django.db.models.deletion.CASCADE,
293
+ to="netbox_dns.zone",
294
+ ),
295
+ ),
296
+ ("status", models.CharField(default="active", max_length=50)),
297
+ ("description", models.CharField(blank=True, max_length=200)),
298
+ ("managed", models.BooleanField(default=False)),
299
+ ("disable_ptr", models.BooleanField(default=False)),
300
+ (
301
+ "ptr_record",
302
+ models.OneToOneField(
303
+ blank=True,
304
+ null=True,
305
+ on_delete=django.db.models.deletion.SET_NULL,
306
+ related_name="address_record",
307
+ to="netbox_dns.record",
308
+ ),
309
+ ),
310
+ (
311
+ "ip_address",
312
+ netbox_dns.fields.address.AddressField(blank=True, null=True),
313
+ ),
314
+ ],
315
+ options={
316
+ "ordering": ("zone", "name", "type", "value", "status"),
317
+ },
318
+ ),
319
+ migrations.AlterField(
320
+ model_name="record",
321
+ name="value",
322
+ field=models.CharField(max_length=65535),
323
+ ),
324
+ migrations.AddField(
325
+ model_name="nameserver",
326
+ name="tenant",
327
+ field=models.ForeignKey(
328
+ blank=True,
329
+ null=True,
330
+ on_delete=django.db.models.deletion.PROTECT,
331
+ related_name="netbox_dns_nameservers",
332
+ to="tenancy.tenant",
333
+ ),
334
+ ),
335
+ migrations.AddField(
336
+ model_name="record",
337
+ name="tenant",
338
+ field=models.ForeignKey(
339
+ blank=True,
340
+ null=True,
341
+ on_delete=django.db.models.deletion.PROTECT,
342
+ related_name="netbox_dns_records",
343
+ to="tenancy.tenant",
344
+ ),
345
+ ),
346
+ migrations.AddField(
347
+ model_name="view",
348
+ name="tenant",
349
+ field=models.ForeignKey(
350
+ blank=True,
351
+ null=True,
352
+ on_delete=django.db.models.deletion.PROTECT,
353
+ related_name="netbox_dns_views",
354
+ to="tenancy.tenant",
355
+ ),
356
+ ),
357
+ migrations.AddField(
358
+ model_name="zone",
359
+ name="tenant",
360
+ field=models.ForeignKey(
361
+ blank=True,
362
+ null=True,
363
+ on_delete=django.db.models.deletion.PROTECT,
364
+ related_name="netbox_dns_zones",
365
+ to="tenancy.tenant",
366
+ ),
367
+ ),
368
+ migrations.AddField(
369
+ model_name="record",
370
+ name="ipam_ip_address",
371
+ field=models.ForeignKey(
372
+ blank=True,
373
+ null=True,
374
+ on_delete=django.db.models.deletion.CASCADE,
375
+ related_name="netbox_dns_records",
376
+ to="ipam.ipaddress",
377
+ ),
378
+ ),
379
+ migrations.CreateModel(
380
+ name="Registrar",
381
+ fields=[
382
+ (
383
+ "id",
384
+ models.BigAutoField(
385
+ auto_created=True, primary_key=True, serialize=False
386
+ ),
387
+ ),
388
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
389
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
390
+ (
391
+ "custom_field_data",
392
+ models.JSONField(
393
+ blank=True,
394
+ default=dict,
395
+ encoder=utilities.json.CustomFieldJSONEncoder,
396
+ ),
397
+ ),
398
+ ("name", models.CharField(max_length=255, unique=True)),
399
+ ("iana_id", models.IntegerField(blank=True, null=True)),
400
+ ("referral_url", models.URLField(blank=True, max_length=255)),
401
+ ("whois_server", models.CharField(blank=True, max_length=255)),
402
+ ("address", models.CharField(blank=True, max_length=200)),
403
+ ("abuse_email", models.EmailField(blank=True, max_length=254)),
404
+ ("abuse_phone", models.CharField(blank=True, max_length=50)),
405
+ (
406
+ "tags",
407
+ taggit.managers.TaggableManager(
408
+ through="extras.TaggedItem", to="extras.Tag"
409
+ ),
410
+ ),
411
+ ],
412
+ options={
413
+ "ordering": ("name", "iana_id"),
414
+ },
415
+ ),
416
+ migrations.CreateModel(
417
+ name="Contact",
418
+ fields=[
419
+ (
420
+ "id",
421
+ models.BigAutoField(
422
+ auto_created=True, primary_key=True, serialize=False
423
+ ),
424
+ ),
425
+ ("created", models.DateTimeField(auto_now_add=True, null=True)),
426
+ ("last_updated", models.DateTimeField(auto_now=True, null=True)),
427
+ (
428
+ "custom_field_data",
429
+ models.JSONField(
430
+ blank=True,
431
+ default=dict,
432
+ encoder=utilities.json.CustomFieldJSONEncoder,
433
+ ),
434
+ ),
435
+ ("name", models.CharField(blank=True, max_length=100)),
436
+ ("contact_id", models.CharField(max_length=50, unique=True)),
437
+ ("organization", models.CharField(blank=True, max_length=200)),
438
+ ("street", models.CharField(blank=True, max_length=50)),
439
+ ("city", models.CharField(blank=True, max_length=50)),
440
+ ("state_province", models.CharField(blank=True, max_length=255)),
441
+ ("postal_code", models.CharField(blank=True, max_length=20)),
442
+ ("country", models.CharField(blank=True, max_length=2)),
443
+ ("phone", models.CharField(blank=True, max_length=50)),
444
+ ("phone_ext", models.CharField(blank=True, max_length=50)),
445
+ ("fax", models.CharField(blank=True, max_length=50)),
446
+ ("fax_ext", models.CharField(blank=True, max_length=50)),
447
+ ("email", models.EmailField(blank=True, max_length=254)),
448
+ (
449
+ "tags",
450
+ taggit.managers.TaggableManager(
451
+ through="extras.TaggedItem", to="extras.Tag"
452
+ ),
453
+ ),
454
+ ],
455
+ options={
456
+ "ordering": ("name", "contact_id"),
457
+ },
458
+ ),
459
+ migrations.AddField(
460
+ model_name="zone",
461
+ name="admin_c",
462
+ field=models.ForeignKey(
463
+ blank=True,
464
+ null=True,
465
+ on_delete=django.db.models.deletion.SET_NULL,
466
+ related_name="admin_c_zones",
467
+ to="netbox_dns.contact",
468
+ ),
469
+ ),
470
+ migrations.AddField(
471
+ model_name="zone",
472
+ name="billing_c",
473
+ field=models.ForeignKey(
474
+ blank=True,
475
+ null=True,
476
+ on_delete=django.db.models.deletion.SET_NULL,
477
+ related_name="billing_c_zones",
478
+ to="netbox_dns.contact",
479
+ ),
480
+ ),
481
+ migrations.AddField(
482
+ model_name="zone",
483
+ name="registrant",
484
+ field=models.ForeignKey(
485
+ blank=True,
486
+ null=True,
487
+ on_delete=django.db.models.deletion.SET_NULL,
488
+ to="netbox_dns.contact",
489
+ ),
490
+ ),
491
+ migrations.AddField(
492
+ model_name="zone",
493
+ name="registrar",
494
+ field=models.ForeignKey(
495
+ blank=True,
496
+ null=True,
497
+ on_delete=django.db.models.deletion.SET_NULL,
498
+ to="netbox_dns.registrar",
499
+ ),
500
+ ),
501
+ migrations.AddField(
502
+ model_name="zone",
503
+ name="registry_domain_id",
504
+ field=models.CharField(blank=True, max_length=50, null=True),
505
+ ),
506
+ migrations.AddField(
507
+ model_name="zone",
508
+ name="tech_c",
509
+ field=models.ForeignKey(
510
+ blank=True,
511
+ null=True,
512
+ on_delete=django.db.models.deletion.SET_NULL,
513
+ related_name="tech_c_zones",
514
+ to="netbox_dns.contact",
515
+ ),
516
+ ),
517
+ migrations.AddField(
518
+ model_name="zone",
519
+ name="rfc2317_prefix",
520
+ field=netbox_dns.fields.rfc2317.RFC2317NetworkField(blank=True, null=True),
521
+ ),
522
+ migrations.AddField(
523
+ model_name="zone",
524
+ name="rfc2317_parent_managed",
525
+ field=models.BooleanField(default=False),
526
+ ),
527
+ migrations.AddField(
528
+ model_name="zone",
529
+ name="rfc2317_parent_zone",
530
+ field=models.ForeignKey(
531
+ blank=True,
532
+ null=True,
533
+ on_delete=django.db.models.deletion.SET_NULL,
534
+ related_name="rfc2317_child_zones",
535
+ to="netbox_dns.zone",
536
+ ),
537
+ ),
538
+ migrations.AddField(
539
+ model_name="record",
540
+ name="rfc2317_cname_record",
541
+ field=models.ForeignKey(
542
+ blank=True,
543
+ null=True,
544
+ on_delete=django.db.models.deletion.SET_NULL,
545
+ related_name="rfc2317_ptr_records",
546
+ to="netbox_dns.record",
547
+ ),
548
+ ),
549
+ migrations.RunPython(update_ip_addresses),
550
+ migrations.AddField(
551
+ model_name="record",
552
+ name="fqdn",
553
+ field=models.CharField(default=None, max_length=255, null=True, blank=True),
554
+ ),
555
+ migrations.RunPython(update_record_fqdn),
556
+ ]
@@ -1,26 +1,21 @@
1
- # Generated by Django 4.0.3 on 2022-07-17 17:41
1
+ # Generated by Django 5.0.1 on 2024-02-24 10:23
2
2
 
3
3
  from django.db import migrations, models
4
4
 
5
5
 
6
6
  class Migration(migrations.Migration):
7
7
  dependencies = [
8
- ("netbox_dns", "0001_initial"),
8
+ ("netbox_dns", "0001_squashed_netbox_dns_0_22"),
9
9
  ]
10
10
 
11
11
  operations = [
12
12
  migrations.AddField(
13
- model_name="nameserver",
13
+ model_name="contact",
14
14
  name="description",
15
15
  field=models.CharField(blank=True, max_length=200),
16
16
  ),
17
17
  migrations.AddField(
18
- model_name="record",
19
- name="description",
20
- field=models.CharField(blank=True, max_length=200),
21
- ),
22
- migrations.AddField(
23
- model_name="zone",
18
+ model_name="registrar",
24
19
  name="description",
25
20
  field=models.CharField(blank=True, max_length=200),
26
21
  ),
@@ -6,7 +6,7 @@ import utilities.json
6
6
 
7
7
  class Migration(migrations.Migration):
8
8
  dependencies = [
9
- ("netbox_dns", "0019_update_ns_ttl"),
9
+ ("netbox_dns", "0001_squashed_netbox_dns_0_15"),
10
10
  ]
11
11
 
12
12
  operations = [
@@ -20,6 +20,10 @@ class Contact(NetBoxModel):
20
20
  blank=True,
21
21
  max_length=100,
22
22
  )
23
+ description = models.CharField(
24
+ blank=True,
25
+ max_length=200,
26
+ )
23
27
  organization = models.CharField(
24
28
  blank=True,
25
29
  max_length=200,
@@ -79,6 +83,7 @@ class Contact(NetBoxModel):
79
83
 
80
84
  clone_fields = [
81
85
  "name",
86
+ "description",
82
87
  "organization",
83
88
  "street",
84
89
  "city",
@@ -94,7 +99,7 @@ class Contact(NetBoxModel):
94
99
  ]
95
100
 
96
101
  def get_absolute_url(self):
97
- return reverse("plugins:netbox_dns:contact", kwargs={"pk": self.id})
102
+ return reverse("plugins:netbox_dns:contact", kwargs={"pk": self.pk})
98
103
 
99
104
  def __str__(self):
100
105
  if self.name is not None:
@@ -39,6 +39,8 @@ class NameServer(NetBoxModel):
39
39
 
40
40
  class Meta:
41
41
  ordering = ("name",)
42
+ verbose_name = "Nameserver"
43
+ verbose_name_plural = "Nameservers"
42
44
 
43
45
  def __str__(self):
44
46
  try:
@@ -53,7 +55,7 @@ class NameServer(NetBoxModel):
53
55
  def get_absolute_url(self):
54
56
  return reverse("plugins:netbox_dns:nameserver", kwargs={"pk": self.pk})
55
57
 
56
- def clean(self, *args, **kwargs):
58
+ def clean(self):
57
59
  try:
58
60
  self.name = normalize_name(self.name)
59
61
  except NameFormatError as exc:
@@ -72,8 +74,6 @@ class NameServer(NetBoxModel):
72
74
  }
73
75
  ) from None
74
76
 
75
- super().clean(*args, **kwargs)
76
-
77
77
  def save(self, *args, **kwargs):
78
78
  self.full_clean()
79
79