netbox-plugin-dns 1.0.5__tar.gz → 1.0.7__tar.gz

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 (140) hide show
  1. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/PKG-INFO +1 -1
  2. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/__init__.py +1 -1
  3. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/nested_serializers.py +18 -17
  4. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/contact.py +1 -1
  5. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/nameserver.py +1 -1
  6. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/record.py +2 -1
  7. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/record_template.py +2 -1
  8. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/registrar.py +1 -1
  9. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/view.py +1 -1
  10. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/zone.py +2 -1
  11. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/zone_template.py +2 -1
  12. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/views.py +0 -28
  13. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/record.py +1 -1
  14. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/zone.py +1 -1
  15. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/address.py +1 -1
  16. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/network.py +1 -1
  17. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/rfc2317.py +4 -1
  18. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/contact.py +1 -1
  19. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/nameserver.py +1 -1
  20. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/record.py +2 -2
  21. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/record_template.py +1 -1
  22. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/registrar.py +1 -1
  23. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/view.py +1 -1
  24. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/zone.py +1 -1
  25. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/zone_template.py +1 -1
  26. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/contact.py +1 -1
  27. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/nameserver.py +14 -3
  28. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/record.py +2 -2
  29. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/record_template.py +1 -1
  30. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/registrar.py +1 -1
  31. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/view.py +1 -1
  32. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/zone.py +17 -6
  33. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/zone_template.py +1 -1
  34. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/schema.py +16 -40
  35. netbox_plugin_dns-1.0.7/netbox_dns/migrations/0007_alter_ordering_options.py +25 -0
  36. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/mixins/object_modification.py +3 -1
  37. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/contact.py +10 -4
  38. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/nameserver.py +9 -4
  39. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/record.py +19 -5
  40. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/record_template.py +5 -2
  41. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/registrar.py +8 -2
  42. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/view.py +10 -3
  43. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/zone.py +19 -13
  44. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/zone_template.py +10 -6
  45. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/contact.py +1 -2
  46. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/nameserver.py +2 -8
  47. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/record.py +11 -31
  48. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/record_template.py +1 -18
  49. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/registrar.py +1 -3
  50. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/view.py +2 -9
  51. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/zone.py +1 -16
  52. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/zone_template.py +3 -17
  53. netbox_plugin_dns-1.0.7/netbox_dns/urls/contact.py +29 -0
  54. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/nameserver.py +14 -38
  55. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/record.py +7 -19
  56. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/record_template.py +18 -27
  57. netbox_plugin_dns-1.0.7/netbox_dns/urls/registrar.py +39 -0
  58. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/view.py +8 -22
  59. netbox_plugin_dns-1.0.7/netbox_dns/urls/zone.py +25 -0
  60. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/zone_template.py +16 -26
  61. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/dns_name.py +10 -1
  62. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/dns_value.py +1 -1
  63. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/rfc2317.py +1 -1
  64. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/contact.py +2 -2
  65. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/nameserver.py +9 -4
  66. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/record.py +10 -3
  67. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/record_template.py +2 -2
  68. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/registrar.py +1 -2
  69. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/view.py +7 -2
  70. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/zone.py +8 -7
  71. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/zone_template.py +3 -3
  72. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/pyproject.toml +1 -1
  73. netbox_plugin_dns-1.0.5/netbox_dns/urls/contact.py +0 -51
  74. netbox_plugin_dns-1.0.5/netbox_dns/urls/registrar.py +0 -63
  75. netbox_plugin_dns-1.0.5/netbox_dns/urls/zone.py +0 -63
  76. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/LICENSE +0 -0
  77. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/README.md +0 -0
  78. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers.py +0 -0
  79. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/serializers_/__init__.py +0 -0
  80. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/api/urls.py +0 -0
  81. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/apps.py +0 -0
  82. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/choices/__init__.py +0 -0
  83. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/fields/__init__.py +0 -0
  84. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/filtersets/__init__.py +0 -0
  85. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/forms/__init__.py +0 -0
  86. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/__init__.py +0 -0
  87. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/filters.py +0 -0
  88. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/graphql/types.py +0 -0
  89. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/cleanup_database.py +0 -0
  90. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
  91. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/setup_coupling.py +0 -0
  92. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/management/commands/update_soa.py +0 -0
  93. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
  94. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
  95. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
  96. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0003_default_view.py +0 -0
  97. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
  98. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
  99. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0006_templating.py +0 -0
  100. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
  101. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  102. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0022_search.py +0 -0
  103. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
  104. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0024_tenancy.py +0 -0
  105. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
  106. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0026_domain_registration.py +0 -0
  107. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
  108. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
  109. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
  110. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/migrations/__init__.py +0 -0
  111. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/mixins/__init__.py +0 -0
  112. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/models/__init__.py +0 -0
  113. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/navigation.py +0 -0
  114. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/signals/__init__.py +0 -0
  115. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/signals/ipam_coupling.py +0 -0
  116. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/tables/__init__.py +0 -0
  117. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/template_content.py +0 -0
  118. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/contact.html +0 -0
  119. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
  120. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  121. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  122. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/record.html +0 -0
  123. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
  124. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
  125. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/related_dns_objects.html +0 -0
  126. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/view.html +0 -0
  127. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
  128. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
  129. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
  130. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
  131. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
  132. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/registration.html +0 -0
  133. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
  134. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zone.html +0 -0
  135. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
  136. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/urls/__init__.py +0 -0
  137. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/utilities/__init__.py +0 -0
  138. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/utilities/ipam_coupling.py +0 -0
  139. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/validators/__init__.py +0 -0
  140. {netbox_plugin_dns-1.0.5 → netbox_plugin_dns-1.0.7}/netbox_dns/views/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: netbox-plugin-dns
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Home-page: https://github.com/peteeckel/netbox-plugin-dns
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  from netbox.plugins import PluginConfig
2
2
 
3
- __version__ = "1.0.5"
3
+ __version__ = "1.0.7"
4
4
 
5
5
 
6
6
  class DNSConfig(PluginConfig):
@@ -6,7 +6,7 @@ from netbox_dns.models import Zone, Record, ZoneTemplate, RecordTemplate
6
6
  from netbox_dns.api.serializers_.view import ViewSerializer
7
7
 
8
8
 
9
- __ALL__ = (
9
+ __all__ = (
10
10
  "NestedZoneSerializer",
11
11
  "NestedRecordSerializer",
12
12
  "NestedZoneTemplateSerializer",
@@ -59,6 +59,22 @@ class NestedZoneSerializer(WritableNestedSerializer):
59
59
  ]
60
60
 
61
61
 
62
+ class NestedZoneTemplateSerializer(WritableNestedSerializer):
63
+ url = serializers.HyperlinkedIdentityField(
64
+ view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
65
+ )
66
+
67
+ class Meta:
68
+ model = ZoneTemplate
69
+ fields = (
70
+ "id",
71
+ "url",
72
+ "name",
73
+ "display",
74
+ "description",
75
+ )
76
+
77
+
62
78
  class NestedRecordSerializer(WritableNestedSerializer):
63
79
  url = serializers.HyperlinkedIdentityField(
64
80
  view_name="plugins-api:netbox_dns-api:record-detail"
@@ -86,6 +102,7 @@ class NestedRecordSerializer(WritableNestedSerializer):
86
102
  "status",
87
103
  "ttl",
88
104
  "zone",
105
+ "managed",
89
106
  "active",
90
107
  ]
91
108
 
@@ -109,19 +126,3 @@ class NestedRecordTemplateSerializer(WritableNestedSerializer):
109
126
  "ttl",
110
127
  "description",
111
128
  )
112
-
113
-
114
- class NestedZoneTemplateSerializer(WritableNestedSerializer):
115
- url = serializers.HyperlinkedIdentityField(
116
- view_name="plugins-api:netbox_dns-api:zonetemplate-detail"
117
- )
118
-
119
- class Meta:
120
- model = ZoneTemplate
121
- fields = (
122
- "id",
123
- "url",
124
- "name",
125
- "display",
126
- "description",
127
- )
@@ -5,7 +5,7 @@ from netbox.api.serializers import NetBoxModelSerializer
5
5
  from netbox_dns.models import Contact
6
6
 
7
7
 
8
- __ALL__ = ("ContactSerializer",)
8
+ __all__ = ("ContactSerializer",)
9
9
 
10
10
 
11
11
  class ContactSerializer(NetBoxModelSerializer):
@@ -8,7 +8,7 @@ from netbox_dns.models import NameServer
8
8
  from ..nested_serializers import NestedZoneSerializer
9
9
 
10
10
 
11
- __ALL__ = ("NameServerSerializer",)
11
+ __all__ = ("NameServerSerializer",)
12
12
 
13
13
 
14
14
  class NameServerSerializer(NetBoxModelSerializer):
@@ -9,7 +9,7 @@ from netbox_dns.models import Record
9
9
  from ..nested_serializers import NestedZoneSerializer, NestedRecordSerializer
10
10
 
11
11
 
12
- __ALL__ = ("RecordSerializer",)
12
+ __all__ = ("RecordSerializer",)
13
13
 
14
14
 
15
15
  class RecordSerializer(NetBoxModelSerializer):
@@ -87,5 +87,6 @@ class RecordSerializer(NetBoxModelSerializer):
87
87
  "status",
88
88
  "ttl",
89
89
  "description",
90
+ "managed",
90
91
  "active",
91
92
  )
@@ -7,7 +7,8 @@ from netbox_dns.models import RecordTemplate
7
7
 
8
8
  from ..nested_serializers import NestedZoneTemplateSerializer
9
9
 
10
- __ALL__ = ("RecordTemplateSerializer",)
10
+
11
+ __all__ = ("RecordTemplateSerializer",)
11
12
 
12
13
 
13
14
  class RecordTemplateSerializer(NetBoxModelSerializer):
@@ -5,7 +5,7 @@ from netbox.api.serializers import NetBoxModelSerializer
5
5
  from netbox_dns.models import Registrar
6
6
 
7
7
 
8
- __ALL__ = ("RegistrarSerializer",)
8
+ __all__ = ("RegistrarSerializer",)
9
9
 
10
10
 
11
11
  class RegistrarSerializer(NetBoxModelSerializer):
@@ -6,7 +6,7 @@ from tenancy.api.serializers_.tenants import TenantSerializer
6
6
  from netbox_dns.models import View
7
7
 
8
8
 
9
- __ALL__ = ("ViewSerializer",)
9
+ __all__ = ("ViewSerializer",)
10
10
 
11
11
 
12
12
  class ViewSerializer(NetBoxModelSerializer):
@@ -13,7 +13,8 @@ from ..nested_serializers import NestedZoneSerializer
13
13
 
14
14
  from netbox_dns.models import Zone
15
15
 
16
- __ALL__ = ("NameServerSerializer",)
16
+
17
+ __all__ = ("ZoneSerializer",)
17
18
 
18
19
 
19
20
  class ZoneSerializer(NetBoxModelSerializer):
@@ -10,7 +10,8 @@ from .nameserver import NameServerSerializer
10
10
  from .registrar import RegistrarSerializer
11
11
  from .contact import ContactSerializer
12
12
 
13
- __ALL__ = ("ZoneTemplateSerializer",)
13
+
14
+ __all__ = ("ZoneTemplateSerializer",)
14
15
 
15
16
 
16
17
  class ZoneTemplateSerializer(NetBoxModelSerializer):
@@ -1,6 +1,4 @@
1
1
  from rest_framework import serializers
2
- from rest_framework.decorators import action
3
- from rest_framework.response import Response
4
2
  from rest_framework.routers import APIRootView
5
3
 
6
4
  from netbox.api.viewsets import NetBoxModelViewSet
@@ -47,12 +45,6 @@ class ViewViewSet(NetBoxModelViewSet):
47
45
  serializer_class = ViewSerializer
48
46
  filterset_class = ViewFilterSet
49
47
 
50
- @action(detail=True, methods=["get"])
51
- def views(self, request, pk=None):
52
- views = View.objects.filter(zone=pk)
53
- serializer = ViewSerializer(views, many=True, context={"request": request})
54
- return Response(serializer.data)
55
-
56
48
 
57
49
  class ZoneViewSet(NetBoxModelViewSet):
58
50
  queryset = Zone.objects.prefetch_related(
@@ -66,32 +58,12 @@ class ZoneViewSet(NetBoxModelViewSet):
66
58
  serializer_class = ZoneSerializer
67
59
  filterset_class = ZoneFilterSet
68
60
 
69
- @action(detail=True, methods=["get"])
70
- def records(self, request, pk=None):
71
- records = Record.objects.filter(zone=pk)
72
- serializer = RecordSerializer(records, many=True, context={"request": request})
73
- return Response(serializer.data)
74
-
75
- @action(detail=True, methods=["get"])
76
- def nameservers(self, request, pk=None):
77
- nameservers = NameServer.objects.filter(zones__id=pk)
78
- serializer = NameServerSerializer(
79
- nameservers, many=True, context={"request": request}
80
- )
81
- return Response(serializer.data)
82
-
83
61
 
84
62
  class NameServerViewSet(NetBoxModelViewSet):
85
63
  queryset = NameServer.objects.prefetch_related("zones", "tenant")
86
64
  serializer_class = NameServerSerializer
87
65
  filterset_class = NameServerFilterSet
88
66
 
89
- @action(detail=True, methods=["get"])
90
- def zones(self, request, pk=None):
91
- zones = Zone.objects.filter(nameservers__id=pk)
92
- serializer = ZoneSerializer(zones, many=True, context={"request": request})
93
- return Response(serializer.data)
94
-
95
67
 
96
68
  class RecordViewSet(NetBoxModelViewSet):
97
69
  queryset = Record.objects.all().prefetch_related("zone", "zone__view", "tenant")
@@ -9,7 +9,7 @@ def initialize_choice_names(cls):
9
9
  return cls
10
10
 
11
11
 
12
- __ALL__ = (
12
+ __all__ = (
13
13
  "RecordTypeChoices",
14
14
  "RecordClassChoices",
15
15
  "RecordStatusChoices",
@@ -1,7 +1,7 @@
1
1
  from utilities.choices import ChoiceSet
2
2
 
3
3
 
4
- __ALL__ = ("ZoneStatusChoices",)
4
+ __all__ = ("ZoneStatusChoices",)
5
5
 
6
6
 
7
7
  class ZoneStatusChoices(ChoiceSet):
@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
5
5
  from netaddr import AddrFormatError, IPAddress
6
6
 
7
7
 
8
- __ALL__ = (
8
+ __all__ = (
9
9
  "AddressFormField",
10
10
  "AddressField",
11
11
  )
@@ -6,7 +6,7 @@ from django.core.exceptions import ValidationError
6
6
  from netaddr import AddrFormatError, IPNetwork
7
7
 
8
8
 
9
- __ALL__ = ()
9
+ __all__ = ("NetworkField",)
10
10
 
11
11
 
12
12
  class NetContains(Lookup):
@@ -10,7 +10,10 @@ from .network import NetContains, NetContained, NetOverlap, NetMaskLength
10
10
  INVALID_RFC2317 = "RFC2317 requires an IPv4 prefix with a length of at least 25 bits."
11
11
 
12
12
 
13
- __ALL__ = ()
13
+ __all__ = (
14
+ "RFC2317NetworkField",
15
+ "RFC2317NetworkFormField",
16
+ )
14
17
 
15
18
 
16
19
  class RFC2317NetworkFormField(forms.Field):
@@ -5,7 +5,7 @@ from netbox.filtersets import NetBoxModelFilterSet
5
5
  from netbox_dns.models import Contact
6
6
 
7
7
 
8
- __ALL__ = ("ContactFilterSet",)
8
+ __all__ = ("ContactFilterSet",)
9
9
 
10
10
 
11
11
  class ContactFilterSet(NetBoxModelFilterSet):
@@ -7,7 +7,7 @@ from tenancy.filtersets import TenancyFilterSet
7
7
  from netbox_dns.models import NameServer, Zone
8
8
 
9
9
 
10
- __ALL__ = ("NameServerFilterSet",)
10
+ __all__ = ("NameServerFilterSet",)
11
11
 
12
12
 
13
13
  class NameServerFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
@@ -13,7 +13,7 @@ from netbox_dns.models import View, Zone, Record
13
13
  from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
14
14
 
15
15
 
16
- __ALL__ = ("RecordFilterSet",)
16
+ __all__ = ("RecordFilterSet",)
17
17
 
18
18
 
19
19
  class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
@@ -121,7 +121,7 @@ class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
121
121
  if not value.strip():
122
122
  return queryset
123
123
  qs_filter = (
124
- Q(name__icontains=value)
124
+ Q(fqdn__icontains=value)
125
125
  | Q(value__icontains=value)
126
126
  | Q(zone__name__icontains=value)
127
127
  )
@@ -8,7 +8,7 @@ from netbox_dns.models import RecordTemplate, ZoneTemplate
8
8
  from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
9
9
 
10
10
 
11
- __ALL__ = ("RecordTemplateFilterSet",)
11
+ __all__ = ("RecordTemplateFilterSet",)
12
12
 
13
13
 
14
14
  class RecordTemplateFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
@@ -5,7 +5,7 @@ from netbox.filtersets import NetBoxModelFilterSet
5
5
  from netbox_dns.models import Registrar
6
6
 
7
7
 
8
- __ALL__ = ("RegistrarFilterSet",)
8
+ __all__ = ("RegistrarFilterSet",)
9
9
 
10
10
 
11
11
  class RegistrarFilterSet(NetBoxModelFilterSet):
@@ -6,7 +6,7 @@ from tenancy.filtersets import TenancyFilterSet
6
6
  from netbox_dns.models import View
7
7
 
8
8
 
9
- __ALL__ = ("ViewFilterSet",)
9
+ __all__ = ("ViewFilterSet",)
10
10
 
11
11
 
12
12
  class ViewFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
@@ -11,7 +11,7 @@ from netbox_dns.models import View, Zone, Registrar, Contact, NameServer
11
11
  from netbox_dns.choices import ZoneStatusChoices
12
12
 
13
13
 
14
- __ALL__ = ("ZoneFilterSet",)
14
+ __all__ = ("ZoneFilterSet",)
15
15
 
16
16
 
17
17
  class ZoneFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
@@ -14,7 +14,7 @@ from netbox_dns.models import (
14
14
  )
15
15
 
16
16
 
17
- __ALL__ = ("ZoneTemplateFilterSet",)
17
+ __all__ = ("ZoneTemplateFilterSet",)
18
18
 
19
19
 
20
20
  class ZoneTemplateFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
@@ -12,7 +12,7 @@ from utilities.forms.rendering import FieldSet
12
12
  from netbox_dns.models import Contact
13
13
 
14
14
 
15
- __ALL__ = (
15
+ __all__ = (
16
16
  "ContactForm",
17
17
  "ContactFilterForm",
18
18
  "ContactImportForm",
@@ -11,16 +11,17 @@ from utilities.forms.fields import (
11
11
  TagFilterField,
12
12
  CSVModelChoiceField,
13
13
  DynamicModelChoiceField,
14
+ DynamicModelMultipleChoiceField,
14
15
  )
15
16
  from utilities.forms.rendering import FieldSet
16
17
  from tenancy.models import Tenant
17
18
  from tenancy.forms import TenancyForm, TenancyFilterForm
18
19
 
19
- from netbox_dns.models import NameServer
20
+ from netbox_dns.models import NameServer, Zone
20
21
  from netbox_dns.utilities import name_to_unicode
21
22
 
22
23
 
23
- __ALL__ = (
24
+ __all__ = (
24
25
  "NameServerForm",
25
26
  "NameServerFilterForm",
26
27
  "NameServerImportForm",
@@ -50,6 +51,16 @@ class NameServerForm(TenancyForm, NetBoxModelForm):
50
51
  class NameServerFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
51
52
  model = NameServer
52
53
 
54
+ zone_id = DynamicModelMultipleChoiceField(
55
+ queryset=Zone.objects.all(),
56
+ required=False,
57
+ label="Zones",
58
+ )
59
+ soa_zone_id = DynamicModelMultipleChoiceField(
60
+ queryset=Zone.objects.all(),
61
+ required=False,
62
+ label="SOA Zones",
63
+ )
53
64
  name = forms.CharField(
54
65
  required=False,
55
66
  )
@@ -60,7 +71,7 @@ class NameServerFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
60
71
 
61
72
  fieldsets = (
62
73
  FieldSet("q", "filter_id", "tag"),
63
- FieldSet("name", "description", name="Attributes"),
74
+ FieldSet("name", "zone_id", "soa_zone_id", "description", name="Attributes"),
64
75
  FieldSet("tenant_group_id", "tenant_id", name="Tenancy"),
65
76
  )
66
77
 
@@ -24,7 +24,7 @@ from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
24
24
  from netbox_dns.utilities import name_to_unicode
25
25
 
26
26
 
27
- __ALL__ = (
27
+ __all__ = (
28
28
  "RecordForm",
29
29
  "RecordFilterForm",
30
30
  "RecordImportForm",
@@ -60,7 +60,7 @@ class RecordForm(TenancyForm, NetBoxModelForm):
60
60
  label="Zone",
61
61
  )
62
62
 
63
- disable_ptr = forms.NullBooleanField(
63
+ disable_ptr = forms.BooleanField(
64
64
  label="Disable PTR",
65
65
  required=False,
66
66
  )
@@ -24,7 +24,7 @@ from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices
24
24
  from netbox_dns.utilities import name_to_unicode
25
25
 
26
26
 
27
- __ALL__ = (
27
+ __all__ = (
28
28
  "RecordTemplateForm",
29
29
  "RecordTemplateFilterForm",
30
30
  "RecordTemplateImportForm",
@@ -12,7 +12,7 @@ from utilities.forms.rendering import FieldSet
12
12
  from netbox_dns.models import Registrar
13
13
 
14
14
 
15
- __ALL__ = (
15
+ __all__ = (
16
16
  "RegistrarForm",
17
17
  "RegistrarFilterForm",
18
18
  "RegistrarImportForm",
@@ -19,7 +19,7 @@ from tenancy.forms import TenancyForm, TenancyFilterForm
19
19
  from netbox_dns.models import View
20
20
 
21
21
 
22
- __ALL__ = (
22
+ __all__ = (
23
23
  "ViewForm",
24
24
  "ViewFilterForm",
25
25
  "ViewImportForm",
@@ -39,7 +39,7 @@ from netbox_dns.fields import RFC2317NetworkFormField
39
39
  from netbox_dns.validators import validate_ipv4, validate_prefix, validate_rfc2317
40
40
 
41
41
 
42
- __ALL__ = (
42
+ __all__ = (
43
43
  "ZoneForm",
44
44
  "ZoneFilterForm",
45
45
  "ZoneImportForm",
@@ -81,6 +81,14 @@ class ZoneTemplateUpdateMixin:
81
81
  else:
82
82
  zone_data = self.cleaned_data.copy()
83
83
 
84
+ custom_fields = dict()
85
+ for key, value in zone_data.copy().items():
86
+ if key.startswith("cf_"):
87
+ custom_fields[key[3:]] = value
88
+ zone_data.pop(key)
89
+ if custom_fields:
90
+ zone_data["custom_field_data"] = custom_fields
91
+
84
92
  zone_data.pop("template", None)
85
93
  zone_data.pop("tenant_group", None)
86
94
  zone_data.pop("_init_time", None)
@@ -261,9 +269,6 @@ class ZoneForm(ZoneTemplateUpdateMixin, TenancyForm, NetBoxModelForm):
261
269
  if self.initial.get("soa_ttl") is None:
262
270
  self.initial["soa_ttl"] = self.initial.get("default_ttl")
263
271
 
264
- if self.initial.get("soa_serial_auto"):
265
- self.initial["soa_serial"] = None
266
-
267
272
  if self.initial.get("soa_mname") is None:
268
273
  default_soa_mname = defaults.get("zone_soa_mname")
269
274
  if default_soa_mname is not None:
@@ -330,7 +335,12 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
330
335
  fieldsets = (
331
336
  FieldSet("q", "filter_id", "tag"),
332
337
  FieldSet(
333
- "view_id", "status", "name", "nameservers", "description", name="Attributes"
338
+ "view_id",
339
+ "status",
340
+ "name",
341
+ "nameserver_id",
342
+ "description",
343
+ name="Attributes",
334
344
  ),
335
345
  FieldSet(
336
346
  "soa_mname_id",
@@ -368,9 +378,10 @@ class ZoneFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
368
378
  name = forms.CharField(
369
379
  required=False,
370
380
  )
371
- nameservers = DynamicModelMultipleChoiceField(
381
+ nameserver_id = DynamicModelMultipleChoiceField(
372
382
  queryset=NameServer.objects.all(),
373
383
  required=False,
384
+ label="Nameservers",
374
385
  )
375
386
  description = forms.CharField(
376
387
  required=False,
@@ -26,7 +26,7 @@ from netbox_dns.models import (
26
26
  )
27
27
 
28
28
 
29
- __ALL__ = (
29
+ __all__ = (
30
30
  "ZoneTemplateForm",
31
31
  "ZoneTemplateFilterForm",
32
32
  "ZoneTemplateImportForm",
@@ -25,79 +25,55 @@ from .types import (
25
25
  )
26
26
 
27
27
 
28
- @strawberry.type
28
+ @strawberry.type(name="Query")
29
29
  class NetBoxDNSNameServerQuery:
30
- @strawberry.field
31
- def netbox_dns_nameserver(self, id: int) -> NetBoxDNSNameServerType:
32
- return NameServer.objects.get(pk=id)
33
-
30
+ netbox_dns_nameserver: NetBoxDNSNameServerType = strawberry_django.field()
34
31
  netbox_dns_nameserver_list: List[NetBoxDNSNameServerType] = (
35
32
  strawberry_django.field()
36
33
  )
37
34
 
38
35
 
39
- @strawberry.type
36
+ @strawberry.type(name="Query")
40
37
  class NetBoxDNSViewQuery:
41
- @strawberry.field
42
- def netbox_dns_view(self, id: int) -> NetBoxDNSViewType:
43
- return View.objects.get(pk=id)
44
-
38
+ netbox_dns_view: NetBoxDNSViewType = strawberry_django.field()
45
39
  netbox_dns_view_list: List[NetBoxDNSViewType] = strawberry_django.field()
46
40
 
47
41
 
48
- @strawberry.type
42
+ @strawberry.type(name="Query")
49
43
  class NetBoxDNSZoneQuery:
50
- @strawberry.field
51
- def netbox_dns_zone(self, id: int) -> NetBoxDNSZoneType:
52
- return Zone.objects.get(pk=id)
53
-
44
+ netbox_dns_zone: NetBoxDNSZoneType = strawberry_django.field()
54
45
  netbox_dns_zone_list: List[NetBoxDNSZoneType] = strawberry_django.field()
55
46
 
56
47
 
57
- @strawberry.type
48
+ @strawberry.type(name="Query")
58
49
  class NetBoxDNSRecordQuery:
59
- @strawberry.field
60
- def netbox_dns_record(self, id: int) -> NetBoxDNSRecordType:
61
- return Record.objects.get(pk=id)
62
-
50
+ netbox_dns_record: NetBoxDNSRecordType = strawberry_django.field()
63
51
  netbox_dns_record_list: List[NetBoxDNSRecordType] = strawberry_django.field()
64
52
 
65
53
 
66
- @strawberry.type
54
+ @strawberry.type(name="Query")
67
55
  class NetBoxDNSContactQuery:
68
- @strawberry.field
69
- def netbox_dns_contact(self, id: int) -> NetBoxDNSContactType:
70
- return Contact.objects.get(pk=id)
71
-
56
+ netbox_dns_contact: NetBoxDNSContactType = strawberry_django.field()
72
57
  netbox_dns_contact_list: List[NetBoxDNSContactType] = strawberry_django.field()
73
58
 
74
59
 
75
- @strawberry.type
60
+ @strawberry.type(name="Query")
76
61
  class NetBoxDNSRegistrarQuery:
77
- @strawberry.field
78
- def netbox_dns_registrar(self, id: int) -> NetBoxDNSRegistrarType:
79
- return Registrar.objects.get(pk=id)
80
-
62
+ netbox_dns_registrar: NetBoxDNSRegistrarType = strawberry_django.field()
81
63
  netbox_dns_registrar_list: List[NetBoxDNSRegistrarType] = strawberry_django.field()
82
64
 
83
65
 
84
- @strawberry.type
66
+ @strawberry.type(name="Query")
85
67
  class NetBoxDNSZoneTemplateQuery:
86
- @strawberry.field
87
- def netbox_dns_zone_template(self, id: int) -> NetBoxDNSZoneTemplateType:
88
- return ZoneTemplate.objects.get(pk=id)
89
-
68
+ netbox_dns_zone_template: NetBoxDNSZoneTemplateType = strawberry_django.field()
90
69
  netbox_dns_zone_template_list: List[NetBoxDNSZoneTemplateType] = (
91
70
  strawberry_django.field()
92
71
  )
93
72
 
94
73
 
95
- @strawberry.type
74
+ @strawberry.type(name="Query")
96
75
  class NetBoxDNSRecordTemplateQuery:
97
- @strawberry.field
98
- def netbox_dns_record_template(self, id: int) -> NetBoxDNSRecordTemplateType:
99
- return RecordTemplate.objects.get(pk=id)
100
-
76
+ netbox_dns_record_template: NetBoxDNSRecordTemplateType = strawberry_django.field()
101
77
  netbox_dns_record_template_list: List[NetBoxDNSRecordTemplateType] = (
102
78
  strawberry_django.field()
103
79
  )
@@ -0,0 +1,25 @@
1
+ # Generated by Django 5.0.7 on 2024-08-27 09:29
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("netbox_dns", "0006_templating"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterModelOptions(
14
+ name="record",
15
+ options={"ordering": ("fqdn", "zone", "name", "type", "value", "status")},
16
+ ),
17
+ migrations.AlterModelOptions(
18
+ name="recordtemplate",
19
+ options={"ordering": ("name",)},
20
+ ),
21
+ migrations.AlterModelOptions(
22
+ name="zonetemplate",
23
+ options={"ordering": ("name",)},
24
+ ),
25
+ ]