netbox-plugin-dns 1.0.3__py3-none-any.whl → 1.0.5__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 (91) hide show
  1. netbox_dns/__init__.py +1 -1
  2. netbox_dns/api/nested_serializers.py +46 -1
  3. netbox_dns/api/serializers.py +2 -0
  4. netbox_dns/api/serializers_/contact.py +3 -0
  5. netbox_dns/api/serializers_/nameserver.py +4 -1
  6. netbox_dns/api/serializers_/record.py +5 -4
  7. netbox_dns/api/serializers_/record_template.py +57 -0
  8. netbox_dns/api/serializers_/registrar.py +3 -0
  9. netbox_dns/api/serializers_/view.py +3 -0
  10. netbox_dns/api/serializers_/zone.py +30 -6
  11. netbox_dns/api/serializers_/zone_template.py +129 -0
  12. netbox_dns/api/urls.py +4 -0
  13. netbox_dns/api/views.py +41 -1
  14. netbox_dns/choices/__init__.py +2 -0
  15. netbox_dns/choices/record.py +49 -0
  16. netbox_dns/choices/zone.py +20 -0
  17. netbox_dns/fields/address.py +6 -0
  18. netbox_dns/fields/network.py +3 -0
  19. netbox_dns/fields/rfc2317.py +3 -0
  20. netbox_dns/filtersets/__init__.py +3 -0
  21. netbox_dns/filtersets/contact.py +3 -0
  22. netbox_dns/filtersets/nameserver.py +3 -0
  23. netbox_dns/filtersets/record.py +5 -1
  24. netbox_dns/filtersets/record_template.py +54 -0
  25. netbox_dns/filtersets/registrar.py +3 -0
  26. netbox_dns/filtersets/view.py +3 -0
  27. netbox_dns/filtersets/zone.py +5 -8
  28. netbox_dns/filtersets/zone_template.py +116 -0
  29. netbox_dns/forms/__init__.py +2 -0
  30. netbox_dns/forms/contact.py +8 -0
  31. netbox_dns/forms/nameserver.py +8 -0
  32. netbox_dns/forms/record.py +25 -11
  33. netbox_dns/forms/record_template.py +220 -0
  34. netbox_dns/forms/registrar.py +8 -0
  35. netbox_dns/forms/view.py +10 -0
  36. netbox_dns/forms/zone.py +109 -36
  37. netbox_dns/forms/zone_template.py +298 -0
  38. netbox_dns/graphql/__init__.py +4 -0
  39. netbox_dns/graphql/filters.py +24 -1
  40. netbox_dns/graphql/schema.py +34 -1
  41. netbox_dns/graphql/types.py +73 -5
  42. netbox_dns/management/commands/cleanup_database.py +2 -6
  43. netbox_dns/management/commands/cleanup_rrset_ttl.py +2 -4
  44. netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +1 -2
  45. netbox_dns/migrations/0006_templating.py +172 -0
  46. netbox_dns/migrations/0021_record_ip_address.py +1 -1
  47. netbox_dns/mixins/object_modification.py +3 -0
  48. netbox_dns/models/__init__.py +7 -0
  49. netbox_dns/models/contact.py +6 -0
  50. netbox_dns/models/nameserver.py +8 -1
  51. netbox_dns/models/record.py +10 -122
  52. netbox_dns/models/record_template.py +180 -0
  53. netbox_dns/models/registrar.py +6 -0
  54. netbox_dns/models/view.py +7 -1
  55. netbox_dns/models/zone.py +57 -66
  56. netbox_dns/models/zone_template.py +149 -0
  57. netbox_dns/navigation.py +47 -0
  58. netbox_dns/tables/__init__.py +2 -0
  59. netbox_dns/tables/contact.py +3 -0
  60. netbox_dns/tables/nameserver.py +3 -2
  61. netbox_dns/tables/record.py +7 -3
  62. netbox_dns/tables/record_template.py +91 -0
  63. netbox_dns/tables/registrar.py +3 -0
  64. netbox_dns/tables/view.py +3 -0
  65. netbox_dns/tables/zone.py +3 -2
  66. netbox_dns/tables/zone_template.py +70 -0
  67. netbox_dns/template_content.py +2 -8
  68. netbox_dns/templates/netbox_dns/recordtemplate.html +84 -0
  69. netbox_dns/templates/netbox_dns/zonetemplate.html +86 -0
  70. netbox_dns/urls/__init__.py +4 -0
  71. netbox_dns/urls/record_template.py +65 -0
  72. netbox_dns/urls/zone_template.py +57 -0
  73. netbox_dns/utilities/ipam_coupling.py +2 -1
  74. netbox_dns/validators/__init__.py +1 -0
  75. netbox_dns/validators/dns_name.py +14 -9
  76. netbox_dns/validators/dns_value.py +83 -0
  77. netbox_dns/validators/rfc2317.py +7 -0
  78. netbox_dns/views/__init__.py +2 -0
  79. netbox_dns/views/contact.py +11 -0
  80. netbox_dns/views/nameserver.py +12 -0
  81. netbox_dns/views/record.py +14 -1
  82. netbox_dns/views/record_template.py +83 -0
  83. netbox_dns/views/registrar.py +12 -0
  84. netbox_dns/views/view.py +12 -0
  85. netbox_dns/views/zone.py +16 -0
  86. netbox_dns/views/zone_template.py +73 -0
  87. {netbox_plugin_dns-1.0.3.dist-info → netbox_plugin_dns-1.0.5.dist-info}/METADATA +2 -1
  88. netbox_plugin_dns-1.0.5.dist-info/RECORD +136 -0
  89. netbox_plugin_dns-1.0.3.dist-info/RECORD +0 -115
  90. {netbox_plugin_dns-1.0.3.dist-info → netbox_plugin_dns-1.0.5.dist-info}/LICENSE +0 -0
  91. {netbox_plugin_dns-1.0.3.dist-info → netbox_plugin_dns-1.0.5.dist-info}/WHEEL +0 -0
netbox_dns/navigation.py CHANGED
@@ -90,6 +90,46 @@ managed_record_menu_item = PluginMenuItem(
90
90
  permissions=["netbox_dns.view_record"],
91
91
  )
92
92
 
93
+ zonetemplate_menu_item = PluginMenuItem(
94
+ link="plugins:netbox_dns:zonetemplate_list",
95
+ link_text="Zone Templates",
96
+ permissions=["netbox_dns.view_zonetemplate"],
97
+ buttons=(
98
+ PluginMenuButton(
99
+ "plugins:netbox_dns:zonetemplate_add",
100
+ "Add",
101
+ "mdi mdi-plus-thick",
102
+ permissions=["netbox_dns.add_zonetemplate"],
103
+ ),
104
+ PluginMenuButton(
105
+ "plugins:netbox_dns:zonetemplate_import",
106
+ "Import",
107
+ "mdi mdi-upload",
108
+ permissions=["netbox_dns.add_zonetemplate"],
109
+ ),
110
+ ),
111
+ )
112
+
113
+ recordtemplate_menu_item = PluginMenuItem(
114
+ link="plugins:netbox_dns:recordtemplate_list",
115
+ link_text="Record Templates",
116
+ permissions=["netbox_dns.view_recordtemplate"],
117
+ buttons=(
118
+ PluginMenuButton(
119
+ "plugins:netbox_dns:recordtemplate_add",
120
+ "Add",
121
+ "mdi mdi-plus-thick",
122
+ permissions=["netbox_dns.add_recordtemplate"],
123
+ ),
124
+ PluginMenuButton(
125
+ "plugins:netbox_dns:recordtemplate_import",
126
+ "Import",
127
+ "mdi mdi-upload",
128
+ permissions=["netbox_dns.add_recordtemplate"],
129
+ ),
130
+ ),
131
+ )
132
+
93
133
  registrar_menu_item = PluginMenuItem(
94
134
  link="plugins:netbox_dns:registrar_list",
95
135
  link_text="Registrars",
@@ -145,6 +185,13 @@ if top_level_menu:
145
185
  managed_record_menu_item,
146
186
  ),
147
187
  ),
188
+ (
189
+ "Templates",
190
+ (
191
+ zonetemplate_menu_item,
192
+ recordtemplate_menu_item,
193
+ ),
194
+ ),
148
195
  (
149
196
  "Domain Registration",
150
197
  (
@@ -4,3 +4,5 @@ from .nameserver import *
4
4
  from .record import *
5
5
  from .contact import *
6
6
  from .registrar import *
7
+ from .zone_template import *
8
+ from .record_template import *
@@ -5,6 +5,9 @@ from netbox.tables import NetBoxTable, TagColumn
5
5
  from netbox_dns.models import Contact
6
6
 
7
7
 
8
+ __ALL__ = ("ContactTable",)
9
+
10
+
8
11
  class ContactTable(NetBoxTable):
9
12
  contact_id = tables.Column(
10
13
  linkify=True,
@@ -6,6 +6,9 @@ from tenancy.tables import TenancyColumnsMixin
6
6
  from netbox_dns.models import NameServer
7
7
 
8
8
 
9
+ __ALL__ = ("NameServerTable",)
10
+
11
+
9
12
  class NameServerTable(TenancyColumnsMixin, NetBoxTable):
10
13
  name = tables.Column(
11
14
  linkify=True,
@@ -20,7 +23,6 @@ class NameServerTable(TenancyColumnsMixin, NetBoxTable):
20
23
  class Meta(NetBoxTable.Meta):
21
24
  model = NameServer
22
25
  fields = (
23
- "pk",
24
26
  "name",
25
27
  "description",
26
28
  "tags",
@@ -28,7 +30,6 @@ class NameServerTable(TenancyColumnsMixin, NetBoxTable):
28
30
  "tenant_group",
29
31
  )
30
32
  default_columns = (
31
- "pk",
32
33
  "name",
33
34
  "tags",
34
35
  )
@@ -3,7 +3,6 @@ import django_tables2 as tables
3
3
  from netbox.tables import (
4
4
  NetBoxTable,
5
5
  ChoiceFieldColumn,
6
- ToggleColumn,
7
6
  TagColumn,
8
7
  ActionsColumn,
9
8
  )
@@ -13,6 +12,13 @@ from netbox_dns.models import Record
13
12
  from netbox_dns.utilities import value_to_unicode
14
13
 
15
14
 
15
+ __ALL__ = (
16
+ "RecordTable",
17
+ "ManagedRecordTable",
18
+ "RelatedRecordTable",
19
+ )
20
+
21
+
16
22
  class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
17
23
  zone = tables.Column(
18
24
  linkify=True,
@@ -44,7 +50,6 @@ class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
44
50
 
45
51
 
46
52
  class RecordTable(RecordBaseTable):
47
- pk = ToggleColumn()
48
53
  status = ChoiceFieldColumn()
49
54
  disable_ptr = tables.BooleanColumn(
50
55
  verbose_name="Disable PTR",
@@ -60,7 +65,6 @@ class RecordTable(RecordBaseTable):
60
65
  class Meta(NetBoxTable.Meta):
61
66
  model = Record
62
67
  fields = (
63
- "pk",
64
68
  "name",
65
69
  "zone",
66
70
  "ttl",
@@ -0,0 +1,91 @@
1
+ import django_tables2 as tables
2
+
3
+ from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
4
+ from tenancy.tables import TenancyColumnsMixin
5
+
6
+ from netbox_dns.models import RecordTemplate
7
+ from netbox_dns.utilities import value_to_unicode
8
+
9
+
10
+ __ALL__ = (
11
+ "RecordTemplateTable",
12
+ "RecordTemplateDisplayTable",
13
+ )
14
+
15
+
16
+ class RecordTemplateTable(TenancyColumnsMixin, NetBoxTable):
17
+ name = tables.Column(
18
+ linkify=True,
19
+ )
20
+ record_name = tables.Column()
21
+ type = tables.Column()
22
+ value = tables.TemplateColumn(
23
+ template_code="{{ value|truncatechars:64 }}",
24
+ )
25
+ unicode_value = tables.TemplateColumn(
26
+ verbose_name="Unicode Value",
27
+ template_code="{{ value|truncatechars:64 }}",
28
+ accessor="value",
29
+ )
30
+ ttl = tables.Column(
31
+ verbose_name="TTL",
32
+ )
33
+ disable_ptr = tables.BooleanColumn(
34
+ verbose_name="Disable PTR",
35
+ )
36
+ tags = TagColumn(
37
+ url_name="plugins:netbox_dns:recordtemplate_list",
38
+ )
39
+
40
+ def render_unicode_value(self, value):
41
+ return value_to_unicode(value)
42
+
43
+ class Meta(NetBoxTable.Meta):
44
+ model = RecordTemplate
45
+ fields = (
46
+ "name",
47
+ "record_name",
48
+ "ttl",
49
+ "type",
50
+ "value",
51
+ "unicode_value",
52
+ "status",
53
+ "disable_ptr",
54
+ "tags",
55
+ "description",
56
+ "tenant",
57
+ "tenant_group",
58
+ )
59
+ default_columns = (
60
+ "name",
61
+ "record_name",
62
+ "ttl",
63
+ "type",
64
+ "value",
65
+ "tags",
66
+ )
67
+
68
+
69
+ class RecordTemplateDisplayTable(RecordTemplateTable):
70
+ actions = ActionsColumn(actions="")
71
+
72
+ class Meta(NetBoxTable.Meta):
73
+ model = RecordTemplate
74
+ fields = (
75
+ "name",
76
+ "record_name",
77
+ "ttl",
78
+ "type",
79
+ "value",
80
+ "unicode_value",
81
+ "status",
82
+ "disable_ptr",
83
+ "description",
84
+ )
85
+ default_columns = (
86
+ "name",
87
+ "record_name",
88
+ "ttl",
89
+ "type",
90
+ "value",
91
+ )
@@ -5,6 +5,9 @@ from netbox.tables import NetBoxTable, TagColumn
5
5
  from netbox_dns.models import Registrar
6
6
 
7
7
 
8
+ __ALL__ = ("RegistrarTable",)
9
+
10
+
8
11
  class RegistrarTable(NetBoxTable):
9
12
  name = tables.Column(
10
13
  linkify=True,
netbox_dns/tables/view.py CHANGED
@@ -6,6 +6,9 @@ from tenancy.tables import TenancyColumnsMixin
6
6
  from netbox_dns.models import View
7
7
 
8
8
 
9
+ __ALL__ = ("ViewTable",)
10
+
11
+
9
12
  class ViewTable(TenancyColumnsMixin, NetBoxTable):
10
13
  name = tables.Column(
11
14
  linkify=True,
netbox_dns/tables/zone.py CHANGED
@@ -10,6 +10,9 @@ from tenancy.tables import TenancyColumnsMixin
10
10
  from netbox_dns.models import Zone
11
11
 
12
12
 
13
+ __ALL__ = ("ZoneTable",)
14
+
15
+
13
16
  class ZoneTable(TenancyColumnsMixin, NetBoxTable):
14
17
  name = tables.Column(
15
18
  linkify=True,
@@ -55,7 +58,6 @@ class ZoneTable(TenancyColumnsMixin, NetBoxTable):
55
58
  class Meta(NetBoxTable.Meta):
56
59
  model = Zone
57
60
  fields = (
58
- "pk",
59
61
  "name",
60
62
  "view",
61
63
  "status",
@@ -78,7 +80,6 @@ class ZoneTable(TenancyColumnsMixin, NetBoxTable):
78
80
  "tenant_group",
79
81
  )
80
82
  default_columns = (
81
- "pk",
82
83
  "name",
83
84
  "view",
84
85
  "status",
@@ -0,0 +1,70 @@
1
+ import django_tables2 as tables
2
+
3
+ from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
4
+ from tenancy.tables import TenancyColumnsMixin
5
+
6
+ from netbox_dns.models import ZoneTemplate
7
+
8
+
9
+ __ALL__ = (
10
+ "ZoneTemplateTable",
11
+ "ZoneTemplateDisplayTable",
12
+ )
13
+
14
+
15
+ class ZoneTemplateTable(TenancyColumnsMixin, NetBoxTable):
16
+ name = tables.Column(
17
+ linkify=True,
18
+ )
19
+ tags = TagColumn(
20
+ url_name="plugins:netbox_dns:zonetemplate_list",
21
+ )
22
+ registrar = tables.Column(
23
+ linkify=True,
24
+ )
25
+ registrant = tables.Column(
26
+ linkify=True,
27
+ )
28
+ admin_c = tables.Column(
29
+ linkify=True,
30
+ )
31
+ tech_c = tables.Column(
32
+ linkify=True,
33
+ )
34
+ billing_c = tables.Column(
35
+ linkify=True,
36
+ )
37
+
38
+ class Meta(NetBoxTable.Meta):
39
+ model = ZoneTemplate
40
+ fields = (
41
+ "name",
42
+ "description",
43
+ "tags",
44
+ "registrar",
45
+ "registrant",
46
+ "admin_c",
47
+ "tech_c",
48
+ "billing_c",
49
+ "tenant",
50
+ "tenant_group",
51
+ )
52
+ default_columns = (
53
+ "name",
54
+ "tags",
55
+ )
56
+
57
+
58
+ class ZoneTemplateDisplayTable(ZoneTemplateTable):
59
+ actions = ActionsColumn(actions="")
60
+
61
+ class Meta(NetBoxTable.Meta):
62
+ model = ZoneTemplate
63
+ fields = (
64
+ "name",
65
+ "description",
66
+ )
67
+ default_columns = (
68
+ "name",
69
+ "description",
70
+ )
@@ -1,11 +1,8 @@
1
- from packaging import version
2
-
3
- from django.conf import settings
4
-
5
1
  from netbox.plugins.utils import get_plugin_config
6
2
  from netbox.plugins import PluginTemplateExtension
7
3
 
8
- from netbox_dns.models import Record, RecordTypeChoices, Zone, View, NameServer
4
+ from netbox_dns.models import Record, Zone, View, NameServer
5
+ from netbox_dns.choices import RecordTypeChoices
9
6
  from netbox_dns.tables import RelatedRecordTable
10
7
 
11
8
 
@@ -119,9 +116,6 @@ class RelatedDNSObjects(PluginTemplateExtension):
119
116
 
120
117
  template_extensions = []
121
118
 
122
- if version.parse(settings.VERSION) < version.parse("3.7.0"):
123
- template_extensions.append(RelatedDNSObjects)
124
-
125
119
  if get_plugin_config("netbox_dns", "feature_ipam_coupling"):
126
120
  template_extensions.append(RelatedDNSRecords)
127
121
  elif get_plugin_config("netbox_dns", "feature_ipam_dns_info"):
@@ -0,0 +1,84 @@
1
+ {% extends 'generic/object.html' %}
2
+ {% load helpers %}
3
+ {% load plugins %}
4
+ {% load render_table from django_tables2 %}
5
+ {% load perms %}
6
+
7
+ {% block content %}
8
+ <div class="row">
9
+ <div class="col col-md-8">
10
+ <div class="card">
11
+ <h5 class="card-header">Record Template</h5>
12
+ <table class="table table-hover attr-table">
13
+ <tr>
14
+ <th scope="row">Template Name</th>
15
+ <td style="word-break:break-all;">{{ object.name }}</td>
16
+ </tr>
17
+ <tr>
18
+ <th scope="row">Name</th>
19
+ <td style="word-break:break-all;">{{ object.record_name }}</td>
20
+ </tr>
21
+ {% if unicode_name %}
22
+ <tr>
23
+ <th scope="row">IDN</th>
24
+ <td style="word-break:break-all;">{{ unicode_name }}</td>
25
+ </tr>
26
+ {% endif %}
27
+ {% if object.tenant %}
28
+ <tr>
29
+ <th scope="row">Tenant</th>
30
+ <td>
31
+ {% if object.tenant.group %}
32
+ {{ object.tenant.group|linkify }} /
33
+ {% endif %}
34
+ {{ object.tenant|linkify|placeholder }}
35
+ </td>
36
+ </tr>
37
+ {% endif %}
38
+ <tr>
39
+ <th scope="row">Type</th>
40
+ <td>{{ object.type }}</td>
41
+ </tr>
42
+ <tr>
43
+ <th scope="row">Value</th>
44
+ <td style="word-break:break-all;">{{ object.value }}</td>
45
+ </tr>
46
+ {% if unicode_value %}
47
+ <tr>
48
+ <th scope="row">Unicode Value</th>
49
+ <td style="word-break:break-all;">{{ unicode_value }}</td>
50
+ </tr>
51
+ {% endif %}
52
+ <tr>
53
+ <th scope="row">TTL</th>
54
+ <td>{{ object.ttl|placeholder }}</td>
55
+ </tr>
56
+ {% if object.type == 'A' or object.type == 'AAAA' %}
57
+ <tr>
58
+ <th scope="row">Disable PTR</th>
59
+ <td>{% checkmark object.disable_ptr %}</td>
60
+ </tr>
61
+ {% endif %}
62
+ <tr>
63
+ <th scope="row">Status</th>
64
+ <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
65
+ </tr>
66
+ {% if object.description %}
67
+ <tr>
68
+ <th scope="row">Description</th>
69
+ <td style="word-break:break-all;">{{ object.description }}</td>
70
+ </tr>
71
+ {% endif %}
72
+ </table>
73
+ </div>
74
+ {% include 'inc/panels/custom_fields.html' %}
75
+ </div>
76
+ <div class="col col-md-4">
77
+ {% include 'inc/panels/tags.html' %}
78
+ </div>
79
+ <div class="col col-md-12">
80
+ {% include 'inc/panel_table.html' with table=zone_template_table heading="Zone Templates" %}
81
+ </div>
82
+ </div>
83
+
84
+ {% endblock %}
@@ -0,0 +1,86 @@
1
+ {% extends 'generic/object.html' %}
2
+ {% load helpers %}
3
+ {% load plugins %}
4
+ {% load render_table from django_tables2 %}
5
+ {% load perms %}
6
+
7
+ {% block content %}
8
+ <div class="row">
9
+ <div class="col col-md-6">
10
+ <div class="card">
11
+ <h5 class="card-header">
12
+ Zone Template
13
+ </h5>
14
+ <table class="table table-hover attr-table">
15
+ <tr>
16
+ <th scope="row">Name</th>
17
+ <td>{{ object.name }}</td>
18
+ </tr>
19
+ {% if object.description %}
20
+ <tr>
21
+ <th scope="row">Description</th>
22
+ <td style="word-break:break-all;">{{ object.description }}</td>
23
+ </tr>
24
+ {% endif %}
25
+ <tr>
26
+ <th scope="row">Tenant</th>
27
+ <td>
28
+ {% if object.tenant.group %}
29
+ {{ object.tenant.group|linkify }} /
30
+ {% endif %}
31
+ {{ object.tenant|linkify|placeholder }}
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <th scope="row">Nameservers</th>
36
+ <td>
37
+ <table>
38
+ {% for nameserver in object.nameservers.all %}
39
+ <tr><td>{{ nameserver|linkify }}</td></tr>
40
+ {% endfor %}
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <th scope="row">Description</th>
46
+ <td>{{ object.description }}</td>
47
+ </tr>
48
+ </table>
49
+ </div>
50
+
51
+ {% include 'inc/panels/tags.html' %}
52
+ {% include 'inc/panels/custom_fields.html' %}
53
+ </div>
54
+ <div class="col col-md-6">
55
+ <div class="card">
56
+ <h5 class="card-header">Domain Registration</h5>
57
+ <table class="table table-hover attr-table">
58
+ <tr>
59
+ <th scope="row">Registrar</th>
60
+ <td>{{ object.registrar|linkify|placeholder }}</td>
61
+ </tr>
62
+ <tr>
63
+ <th scope="row">Registrant</th>
64
+ <td>{{ object.registrant|linkify|placeholder }}</td>
65
+ </tr>
66
+ <tr>
67
+ <th scope="row">Administrative Contact</th>
68
+ <td>{{ object.admin_c|linkify|placeholder }}</td>
69
+ </tr>
70
+ <tr>
71
+ <th scope="row">Technical Contact</th>
72
+ <td>{{ object.tech_c|linkify|placeholder }}</td>
73
+ </tr>
74
+ <tr>
75
+ <th scope="row">Billing Contact</th>
76
+ <td>{{ object.billing_c|linkify|placeholder }}</td>
77
+ </tr>
78
+ </table>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ <div class="col col-md-12">
83
+ {% include 'inc/panel_table.html' with table=record_template_table heading="Record Templates" %}
84
+ </div>
85
+ </div>
86
+ {% endblock %}
@@ -1,9 +1,11 @@
1
1
  from .contact import contact_urlpatterns
2
2
  from .nameserver import nameserver_urlpatterns
3
3
  from .record import record_urlpatterns
4
+ from .record_template import recordtemplate_urlpatterns
4
5
  from .registrar import registrar_urlpatterns
5
6
  from .view import view_urlpatterns
6
7
  from .zone import zone_urlpatterns
8
+ from .zone_template import zonetemplate_urlpatterns
7
9
 
8
10
  app_name = "netbox_dns"
9
11
 
@@ -11,7 +13,9 @@ urlpatterns = (
11
13
  contact_urlpatterns
12
14
  + nameserver_urlpatterns
13
15
  + record_urlpatterns
16
+ + recordtemplate_urlpatterns
14
17
  + registrar_urlpatterns
15
18
  + view_urlpatterns
16
19
  + zone_urlpatterns
20
+ + zonetemplate_urlpatterns
17
21
  )
@@ -0,0 +1,65 @@
1
+ from django.urls import path
2
+
3
+ from netbox.views.generic import ObjectChangeLogView, ObjectJournalView
4
+
5
+ from netbox_dns.models import RecordTemplate
6
+ from netbox_dns.views import (
7
+ RecordTemplateListView,
8
+ RecordTemplateView,
9
+ RecordTemplateEditView,
10
+ RecordTemplateDeleteView,
11
+ RecordTemplateBulkImportView,
12
+ RecordTemplateBulkEditView,
13
+ RecordTemplateBulkDeleteView,
14
+ )
15
+
16
+ recordtemplate_urlpatterns = [
17
+ path(
18
+ "recordtemplates/", RecordTemplateListView.as_view(), name="recordtemplate_list"
19
+ ),
20
+ path(
21
+ "recordtemplates/add/",
22
+ RecordTemplateEditView.as_view(),
23
+ name="recordtemplate_add",
24
+ ),
25
+ path(
26
+ "recordtemplates/import/",
27
+ RecordTemplateBulkImportView.as_view(),
28
+ name="recordtemplate_import",
29
+ ),
30
+ path(
31
+ "recordtemplates/edit/",
32
+ RecordTemplateBulkEditView.as_view(),
33
+ name="recordtemplate_bulk_edit",
34
+ ),
35
+ path(
36
+ "recordtemplates/delete/",
37
+ RecordTemplateBulkDeleteView.as_view(),
38
+ name="recordtemplate_bulk_delete",
39
+ ),
40
+ path(
41
+ "recordtemplates/<int:pk>/", RecordTemplateView.as_view(), name="recordtemplate"
42
+ ),
43
+ path(
44
+ "recordtemplates/<int:pk>/edit/",
45
+ RecordTemplateEditView.as_view(),
46
+ name="recordtemplate_edit",
47
+ ),
48
+ path(
49
+ "recordtemplates/<int:pk>/delete/",
50
+ RecordTemplateDeleteView.as_view(),
51
+ name="recordtemplate_delete",
52
+ ),
53
+ path(
54
+ "recordtemplates/<int:pk>/journal/",
55
+ ObjectJournalView.as_view(),
56
+ name="recordtemplate_journal",
57
+ kwargs={"model": RecordTemplate},
58
+ ),
59
+ path(
60
+ "recordtemplates/<int:pk>/changelog/",
61
+ ObjectChangeLogView.as_view(),
62
+ name="recordtemplate_changelog",
63
+ kwargs={"model": RecordTemplate},
64
+ ),
65
+ ]
@@ -0,0 +1,57 @@
1
+ from django.urls import path
2
+
3
+ from netbox.views.generic import ObjectChangeLogView, ObjectJournalView
4
+
5
+ from netbox_dns.models import ZoneTemplate
6
+ from netbox_dns.views import (
7
+ ZoneTemplateListView,
8
+ ZoneTemplateView,
9
+ ZoneTemplateDeleteView,
10
+ ZoneTemplateEditView,
11
+ ZoneTemplateBulkImportView,
12
+ ZoneTemplateBulkEditView,
13
+ ZoneTemplateBulkDeleteView,
14
+ )
15
+
16
+ zonetemplate_urlpatterns = [
17
+ path("zonetemplates/", ZoneTemplateListView.as_view(), name="zonetemplate_list"),
18
+ path("zonetemplates/add/", ZoneTemplateEditView.as_view(), name="zonetemplate_add"),
19
+ path(
20
+ "zonetemplates/import/",
21
+ ZoneTemplateBulkImportView.as_view(),
22
+ name="zonetemplate_import",
23
+ ),
24
+ path(
25
+ "zonetemplates/edit/",
26
+ ZoneTemplateBulkEditView.as_view(),
27
+ name="zonetemplate_bulk_edit",
28
+ ),
29
+ path(
30
+ "zonetemplates/delete/",
31
+ ZoneTemplateBulkDeleteView.as_view(),
32
+ name="zonetemplate_bulk_delete",
33
+ ),
34
+ path("zonetemplates/<int:pk>/", ZoneTemplateView.as_view(), name="zonetemplate"),
35
+ path(
36
+ "zonetemplates/<int:pk>/delete/",
37
+ ZoneTemplateDeleteView.as_view(),
38
+ name="zonetemplate_delete",
39
+ ),
40
+ path(
41
+ "zonetemplates/<int:pk>/edit/",
42
+ ZoneTemplateEditView.as_view(),
43
+ name="zonetemplate_edit",
44
+ ),
45
+ path(
46
+ "zonetemplates/<int:pk>/journal/",
47
+ ObjectJournalView.as_view(),
48
+ name="zonetemplate_journal",
49
+ kwargs={"model": ZoneTemplate},
50
+ ),
51
+ path(
52
+ "zonetemplates/<int:pk>/changelog/",
53
+ ObjectChangeLogView.as_view(),
54
+ name="zonetemplate_changelog",
55
+ kwargs={"model": ZoneTemplate},
56
+ ),
57
+ ]