netbox-plugin-dns 1.1.2__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 (84) hide show
  1. netbox_dns/__init__.py +6 -5
  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 +2 -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 +49 -27
  27. netbox_dns/forms/zone.py +167 -120
  28. netbox_dns/forms/zone_template.py +53 -43
  29. netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  30. netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  31. netbox_dns/management/commands/rebuild_dnssync.py +14 -1
  32. netbox_dns/models/nameserver.py +6 -2
  33. netbox_dns/models/record.py +63 -30
  34. netbox_dns/models/record_template.py +16 -8
  35. netbox_dns/models/registrar.py +11 -7
  36. netbox_dns/models/registration_contact.py +23 -11
  37. netbox_dns/models/view.py +15 -6
  38. netbox_dns/models/zone.py +65 -43
  39. netbox_dns/models/zone_template.py +12 -10
  40. netbox_dns/navigation.py +30 -28
  41. netbox_dns/signals/ipam_dnssync.py +21 -14
  42. netbox_dns/tables/ipam_dnssync.py +2 -1
  43. netbox_dns/tables/nameserver.py +2 -0
  44. netbox_dns/tables/record.py +21 -11
  45. netbox_dns/tables/record_template.py +12 -5
  46. netbox_dns/tables/registrar.py +2 -0
  47. netbox_dns/tables/registration_contact.py +2 -0
  48. netbox_dns/tables/view.py +3 -1
  49. netbox_dns/tables/zone.py +15 -2
  50. netbox_dns/tables/zone_template.py +7 -0
  51. netbox_dns/templates/netbox_dns/nameserver.html +6 -5
  52. netbox_dns/templates/netbox_dns/record/managed.html +2 -1
  53. netbox_dns/templates/netbox_dns/record/related.html +26 -14
  54. netbox_dns/templates/netbox_dns/record.html +39 -20
  55. netbox_dns/templates/netbox_dns/recordtemplate.html +27 -15
  56. netbox_dns/templates/netbox_dns/registrar.html +11 -10
  57. netbox_dns/templates/netbox_dns/registrationcontact.html +16 -15
  58. netbox_dns/templates/netbox_dns/view/button.html +2 -1
  59. netbox_dns/templates/netbox_dns/view/prefix.html +7 -4
  60. netbox_dns/templates/netbox_dns/view/related.html +26 -10
  61. netbox_dns/templates/netbox_dns/view.html +11 -14
  62. netbox_dns/templates/netbox_dns/zone/base.html +2 -1
  63. netbox_dns/templates/netbox_dns/zone/child.html +3 -2
  64. netbox_dns/templates/netbox_dns/zone/record.html +3 -2
  65. netbox_dns/templates/netbox_dns/zone/registration.html +8 -7
  66. netbox_dns/templates/netbox_dns/zone.html +28 -30
  67. netbox_dns/templates/netbox_dns/zonetemplate.html +27 -17
  68. netbox_dns/utilities/ipam_dnssync.py +15 -4
  69. netbox_dns/validators/dns_name.py +11 -4
  70. netbox_dns/validators/dns_value.py +9 -4
  71. netbox_dns/validators/rfc2317.py +6 -3
  72. netbox_dns/views/nameserver.py +4 -2
  73. netbox_dns/views/record_template.py +4 -3
  74. netbox_dns/views/registrar.py +3 -1
  75. netbox_dns/views/registration_contact.py +2 -1
  76. netbox_dns/views/view.py +2 -1
  77. netbox_dns/views/zone.py +6 -4
  78. netbox_dns/views/zone_template.py +8 -7
  79. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/METADATA +1 -1
  80. netbox_plugin_dns-1.1.3.dist-info/RECORD +150 -0
  81. netbox_plugin_dns-1.1.2.dist-info/RECORD +0 -148
  82. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/LICENSE +0 -0
  83. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/WHEEL +0 -0
  84. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.3.dist-info}/top_level.txt +0 -0
netbox_dns/__init__.py CHANGED
@@ -1,17 +1,18 @@
1
1
  from django.conf import settings
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.plugins import PluginConfig
4
5
  from ipam.choices import IPAddressStatusChoices
5
6
 
6
7
  from netbox_dns.choices import RecordTypeChoices
7
8
 
8
- __version__ = "1.1.2"
9
+ __version__ = "1.1.3"
9
10
 
10
11
 
11
12
  class DNSConfig(PluginConfig):
12
13
  name = "netbox_dns"
13
- verbose_name = "NetBox DNS"
14
- description = "NetBox plugin for DNS data"
14
+ verbose_name = _("NetBox DNS")
15
+ description = _("NetBox plugin for DNS data")
15
16
  min_version = "4.0.0"
16
17
  version = __version__
17
18
  author = "Peter Eckel"
@@ -54,8 +55,8 @@ class DNSConfig(PluginConfig):
54
55
  super().ready()
55
56
 
56
57
  if not settings.PLUGINS_CONFIG["netbox_dns"].get("dnssync_disabled"):
57
- import netbox_dns.signals.ipam_dnssync
58
- import netbox_dns.tables.ipam_dnssync
58
+ import netbox_dns.signals.ipam_dnssync # noqa: F401
59
+ import netbox_dns.tables.ipam_dnssync # noqa: F401
59
60
 
60
61
 
61
62
  #
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import WritableNestedSerializer
@@ -37,7 +38,7 @@ class NestedZoneSerializer(WritableNestedSerializer):
37
38
  many=False,
38
39
  required=False,
39
40
  read_only=True,
40
- help_text="View the zone belongs to",
41
+ help_text=_("View the zone belongs to"),
41
42
  )
42
43
  active = serializers.BooleanField(
43
44
  required=False,
@@ -82,7 +83,7 @@ class NestedRecordSerializer(WritableNestedSerializer):
82
83
  zone = NestedZoneSerializer(
83
84
  many=False,
84
85
  required=False,
85
- help_text="Zone the record belongs to",
86
+ help_text=_("Zone the record belongs to"),
86
87
  )
87
88
  active = serializers.BooleanField(
88
89
  required=False,
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -20,7 +21,7 @@ class NameServerSerializer(NetBoxModelSerializer):
20
21
  read_only=True,
21
22
  required=False,
22
23
  default=None,
23
- help_text="Zones served by the authoritative nameserver",
24
+ help_text=_("Zones served by the authoritative nameserver"),
24
25
  )
25
26
  tenant = TenantSerializer(required=False, allow_null=True)
26
27
 
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -21,19 +22,19 @@ class RecordSerializer(NetBoxModelSerializer):
21
22
  read_only=True,
22
23
  required=False,
23
24
  allow_null=True,
24
- help_text="PTR record generated from an address",
25
+ help_text=_("PTR record generated from an address"),
25
26
  )
26
27
  address_record = NestedRecordSerializer(
27
28
  many=False,
28
29
  read_only=True,
29
30
  required=False,
30
31
  allow_null=True,
31
- help_text="Address record defining the PTR",
32
+ help_text=_("Address record defining the PTR"),
32
33
  )
33
34
  zone = NestedZoneSerializer(
34
35
  many=False,
35
36
  required=False,
36
- help_text="Zone the record belongs to",
37
+ help_text=_("Zone the record belongs to"),
37
38
  )
38
39
  active = serializers.BooleanField(
39
40
  required=False,
@@ -45,7 +46,7 @@ class RecordSerializer(NetBoxModelSerializer):
45
46
  read_only=True,
46
47
  required=False,
47
48
  allow_null=True,
48
- help_text="IPAddress linked to the record",
49
+ help_text=_("IPAddress linked to the record"),
49
50
  )
50
51
  tenant = TenantSerializer(nested=True, required=False, allow_null=True)
51
52
 
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -20,7 +21,7 @@ class RecordTemplateSerializer(NetBoxModelSerializer):
20
21
  many=True,
21
22
  read_only=True,
22
23
  required=False,
23
- help_text="Zone templates using the record template",
24
+ help_text=_("Zone templates using the record template"),
24
25
  )
25
26
 
26
27
  class Meta:
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -22,7 +23,7 @@ class ViewSerializer(NetBoxModelSerializer):
22
23
  nested=True,
23
24
  read_only=False,
24
25
  required=False,
25
- help_text="IPAM Prefixes assigned to the View",
26
+ help_text=_("IPAM Prefixes assigned to the View"),
26
27
  )
27
28
  tenant = TenantSerializer(
28
29
  nested=True,
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -27,75 +28,75 @@ class ZoneSerializer(NetBoxModelSerializer):
27
28
  read_only=False,
28
29
  required=False,
29
30
  default=None,
30
- help_text="View the zone belongs to",
31
+ help_text=_("View the zone belongs to"),
31
32
  )
32
33
  nameservers = NameServerSerializer(
33
34
  nested=True,
34
35
  many=True,
35
36
  read_only=False,
36
37
  required=False,
37
- help_text="Nameservers for the zone",
38
+ help_text=_("Nameservers for the zone"),
38
39
  )
39
40
  soa_mname = NameServerSerializer(
40
41
  nested=True,
41
42
  many=False,
42
43
  read_only=False,
43
44
  required=False,
44
- help_text="Primary nameserver for the zone",
45
+ help_text=_("Primary nameserver for the zone"),
45
46
  )
46
47
  rfc2317_parent_zone = NestedZoneSerializer(
47
48
  many=False,
48
49
  read_only=True,
49
50
  required=False,
50
- help_text="RFC2317 arent zone for the zone",
51
+ help_text=_("RFC2317 parent zone of the zone"),
51
52
  )
52
53
  rfc2317_child_zones = NestedZoneSerializer(
53
54
  many=True,
54
55
  read_only=True,
55
56
  required=False,
56
- help_text="RFC2317 child zones of the zone",
57
+ help_text=_("RFC2317 child zones of the zone"),
57
58
  )
58
59
  registrar = RegistrarSerializer(
59
60
  nested=True,
60
61
  many=False,
61
62
  read_only=False,
62
63
  required=False,
63
- help_text="The registrar the domain is registered with",
64
+ help_text=_("Registrar the domain is registered with"),
64
65
  )
65
66
  registrant = RegistrationContactSerializer(
66
67
  nested=True,
67
68
  many=False,
68
69
  read_only=False,
69
70
  required=False,
70
- help_text="The owner of the domain",
71
+ help_text=_("Registrant of the domain"),
71
72
  )
72
73
  admin_c = RegistrationContactSerializer(
73
74
  nested=True,
74
75
  many=False,
75
76
  read_only=False,
76
77
  required=False,
77
- help_text="The administrative contact for the domain",
78
+ help_text=_("Administrative contact for the domain"),
78
79
  )
79
80
  tech_c = RegistrationContactSerializer(
80
81
  nested=True,
81
82
  many=False,
82
83
  read_only=False,
83
84
  required=False,
84
- help_text="The technical contact for the domain",
85
+ help_text=_("Technical contact for the domain"),
85
86
  )
86
87
  billing_c = RegistrationContactSerializer(
87
88
  nested=True,
88
89
  many=False,
89
90
  read_only=False,
90
91
  required=False,
91
- help_text="The billing contact for the domain",
92
+ help_text=_("Billing contact for the domain"),
92
93
  )
93
94
  template = ZoneTemplateSerializer(
94
95
  nested=True,
95
96
  write_only=True,
96
97
  required=False,
97
98
  default=None,
98
- help_text="Template to apply to the zone",
99
+ help_text=_("Template to apply to the zone"),
99
100
  )
100
101
  active = serializers.BooleanField(
101
102
  required=False,
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
 
3
4
  from netbox.api.serializers import NetBoxModelSerializer
@@ -23,48 +24,48 @@ class ZoneTemplateSerializer(NetBoxModelSerializer):
23
24
  many=True,
24
25
  read_only=False,
25
26
  required=False,
26
- help_text="Nameservers for the zone",
27
+ help_text=_("Nameservers for the zone"),
27
28
  )
28
29
  record_templates = NestedRecordTemplateSerializer(
29
30
  many=True,
30
31
  read_only=False,
31
32
  required=False,
32
- help_text="Record templates assigned to the zone",
33
+ help_text=_("Record templates assigned to the zone template"),
33
34
  )
34
35
  registrar = RegistrarSerializer(
35
36
  nested=True,
36
37
  many=False,
37
38
  read_only=False,
38
39
  required=False,
39
- help_text="The registrar the domain is registered with",
40
+ help_text=_("Registrar the domain is registered with"),
40
41
  )
41
42
  registrant = RegistrationContactSerializer(
42
43
  nested=True,
43
44
  many=False,
44
45
  read_only=False,
45
46
  required=False,
46
- help_text="The owner of the domain",
47
+ help_text=_("Registrant of the domain"),
47
48
  )
48
49
  admin_c = RegistrationContactSerializer(
49
50
  nested=True,
50
51
  many=False,
51
52
  read_only=False,
52
53
  required=False,
53
- help_text="The administrative contact for the domain",
54
+ help_text=_("Administrative contact for the domain"),
54
55
  )
55
56
  tech_c = RegistrationContactSerializer(
56
57
  nested=True,
57
58
  many=False,
58
59
  read_only=False,
59
60
  required=False,
60
- help_text="The technical contact for the domain",
61
+ help_text=_("Technical contact for the domain"),
61
62
  )
62
63
  billing_c = RegistrationContactSerializer(
63
64
  nested=True,
64
65
  many=False,
65
66
  read_only=False,
66
67
  required=False,
67
- help_text="The billing contact for the domain",
68
+ help_text=_("Billing contact for the domain"),
68
69
  )
69
70
  active = serializers.BooleanField(
70
71
  required=False,
netbox_dns/api/views.py CHANGED
@@ -1,3 +1,4 @@
1
+ from django.utils.translation import gettext as _
1
2
  from rest_framework import serializers
2
3
  from rest_framework.routers import APIRootView
3
4
 
@@ -80,7 +81,7 @@ class RecordViewSet(NetBoxModelViewSet):
80
81
  data = [data]
81
82
 
82
83
  if any(record.get("managed") for record in data):
83
- raise serializers.ValidationError("'managed' is True, refusing create")
84
+ raise serializers.ValidationError(_("'managed' is True, refusing create"))
84
85
 
85
86
  return super().create(request, *args, **kwargs)
86
87
 
@@ -88,7 +89,7 @@ class RecordViewSet(NetBoxModelViewSet):
88
89
  v_object = self.get_object()
89
90
  if v_object.managed:
90
91
  raise serializers.ValidationError(
91
- f"{v_object} is managed, refusing deletion"
92
+ _("{object} is managed, refusing deletion").format(object=v_object)
92
93
  )
93
94
 
94
95
  return super().destroy(request, *args, **kwargs)
@@ -96,11 +97,15 @@ class RecordViewSet(NetBoxModelViewSet):
96
97
  def update(self, request, *args, **kwargs):
97
98
  v_object = self.get_object()
98
99
  if v_object.managed:
99
- raise serializers.ValidationError(f"{v_object} is managed, refusing update")
100
+ raise serializers.ValidationError(
101
+ _("{object} is managed, refusing update").format(object=v_object)
102
+ )
100
103
 
101
104
  if request.data.get("managed"):
102
105
  raise serializers.ValidationError(
103
- f"{v_object} is unmanaged, refusing update to managed"
106
+ _("{object} is unmanaged, refusing update to managed").format(
107
+ object=v_object
108
+ )
104
109
  )
105
110
 
106
111
  return super().update(request, *args, **kwargs)
@@ -1,5 +1,7 @@
1
1
  from dns import rdatatype, rdataclass
2
2
 
3
+ from django.utils.translation import gettext_lazy as _
4
+
3
5
  from utilities.choices import ChoiceSet
4
6
 
5
7
 
@@ -44,6 +46,6 @@ class RecordStatusChoices(ChoiceSet):
44
46
  STATUS_INACTIVE = "inactive"
45
47
 
46
48
  CHOICES = [
47
- (STATUS_ACTIVE, "Active", "blue"),
48
- (STATUS_INACTIVE, "Inactive", "red"),
49
+ (STATUS_ACTIVE, _("Active"), "blue"),
50
+ (STATUS_INACTIVE, _("Inactive"), "red"),
49
51
  ]
@@ -1,3 +1,5 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+
1
3
  from utilities.choices import ChoiceSet
2
4
 
3
5
 
@@ -13,8 +15,8 @@ class ZoneStatusChoices(ChoiceSet):
13
15
  STATUS_PARKED = "parked"
14
16
 
15
17
  CHOICES = [
16
- (STATUS_ACTIVE, "Active", "blue"),
17
- (STATUS_RESERVED, "Reserved", "cyan"),
18
- (STATUS_DEPRECATED, "Deprecated", "red"),
19
- (STATUS_PARKED, "Parked", "gray"),
18
+ (STATUS_ACTIVE, _("Active"), "blue"),
19
+ (STATUS_RESERVED, _("Reserved"), "cyan"),
20
+ (STATUS_DEPRECATED, _("Deprecated"), "red"),
21
+ (STATUS_PARKED, _("Parked"), "gray"),
20
22
  ]
@@ -1,6 +1,7 @@
1
1
  from django import forms
2
2
  from django.db import models
3
3
  from django.core.exceptions import ValidationError
4
+ from django.utils.translation import gettext_lazy as _
4
5
 
5
6
  from netaddr import AddrFormatError, IPAddress
6
7
 
@@ -28,7 +29,7 @@ class AddressFormField(forms.Field):
28
29
 
29
30
 
30
31
  class AddressField(models.Field):
31
- description = "IPv4/v6 address"
32
+ description = _("IPv4/v6 address")
32
33
 
33
34
  def python_type(self):
34
35
  return IPAddress
@@ -2,6 +2,7 @@ from django import forms
2
2
  from django.db import models
3
3
  from django.db.models import Lookup, Transform, IntegerField
4
4
  from django.core.exceptions import ValidationError
5
+ from django.utils.translation import gettext_lazy as _
5
6
 
6
7
  from netaddr import AddrFormatError, IPNetwork
7
8
 
@@ -76,7 +77,7 @@ class NetworkFormField(forms.Field):
76
77
 
77
78
 
78
79
  class NetworkField(models.Field):
79
- description = "IPv4/v6 network associated with a reverse lookup zone"
80
+ description = _("IPv4/v6 network associated with a reverse lookup zone")
80
81
 
81
82
  def python_type(self):
82
83
  return IPNetwork
@@ -3,11 +3,14 @@ from netaddr import IPNetwork, AddrFormatError
3
3
  from django import forms
4
4
  from django.db import models
5
5
  from django.core.exceptions import ValidationError
6
+ from django.utils.translation import gettext_lazy as _
6
7
 
7
8
  from netbox_dns.validators import validate_ipv4, validate_prefix, validate_rfc2317
8
9
  from .network import NetContains, NetContained, NetOverlap, NetMaskLength
9
10
 
10
- INVALID_RFC2317 = "RFC2317 requires an IPv4 prefix with a length of at least 25 bits."
11
+ INVALID_RFC2317 = _(
12
+ "RFC2317 requires an IPv4 prefix with a length of at least 25 bits."
13
+ )
11
14
 
12
15
 
13
16
  __all__ = (
@@ -28,7 +31,7 @@ class RFC2317NetworkFormField(forms.Field):
28
31
  raise ValidationError(INVALID_RFC2317)
29
32
 
30
33
  if len(value.split("/")) != 2:
31
- raise ValidationError("Please specify the prefix length")
34
+ raise ValidationError(_("Please specify the prefix length"))
32
35
 
33
36
  try:
34
37
  ip_network = IPNetwork(value)
@@ -42,7 +45,8 @@ class RFC2317NetworkFormField(forms.Field):
42
45
 
43
46
 
44
47
  class RFC2317NetworkField(models.Field):
45
- description = "PostgreSQL CIDR field for an RFC2317 prefix"
48
+ description = _("PostgreSQL CIDR field for an RFC2317 prefix")
49
+
46
50
  default_validators = [validate_ipv4, validate_prefix, validate_rfc2317]
47
51
 
48
52
  def python_type(self):
@@ -1,5 +1,6 @@
1
1
  import django_filters
2
2
  from django.db.models import Q
3
+ from django.utils.translation import gettext as _
3
4
 
4
5
  from netbox.filtersets import NetBoxModelFilterSet
5
6
  from tenancy.filtersets import TenancyFilterSet
@@ -15,12 +16,12 @@ class NameServerFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
15
16
  field_name="zones",
16
17
  queryset=Zone.objects.all(),
17
18
  to_field_name="id",
18
- label="Zones",
19
+ label=_("Zones"),
19
20
  )
20
21
  soa_zone_id = django_filters.ModelMultipleChoiceFilter(
21
22
  method="filter_soa_zones",
22
23
  queryset=Zone.objects.all(),
23
- label="SOA Zones",
24
+ label=_("SOA Zones"),
24
25
  )
25
26
 
26
27
  class Meta:
@@ -2,6 +2,7 @@ import netaddr
2
2
 
3
3
  import django_filters
4
4
  from django.db.models import Q
5
+ from django.utils.translation import gettext as _
5
6
 
6
7
  from netbox.filtersets import NetBoxModelFilterSet
7
8
  from tenancy.filtersets import TenancyFilterSet
@@ -28,52 +29,52 @@ class RecordFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
28
29
  )
29
30
  zone_id = django_filters.ModelMultipleChoiceFilter(
30
31
  queryset=Zone.objects.all(),
31
- label="Parent Zone ID",
32
+ label=_("Parent Zone ID"),
32
33
  )
33
34
  zone = django_filters.ModelMultipleChoiceFilter(
34
35
  queryset=Zone.objects.all(),
35
36
  field_name="zone__name",
36
37
  to_field_name="name",
37
- label="Parent Zone",
38
+ label=_("Parent Zone"),
38
39
  )
39
40
  view_id = django_filters.ModelMultipleChoiceFilter(
40
41
  queryset=View.objects.all(),
41
42
  field_name="zone__view",
42
- label="ID of the View the Parent Zone belongs to",
43
+ label=_("ID of the View the Parent Zone belongs to"),
43
44
  )
44
45
  view = django_filters.ModelMultipleChoiceFilter(
45
46
  queryset=View.objects.all(),
46
47
  field_name="zone__view__name",
47
48
  to_field_name="name",
48
- label="View the Parent Zone belongs to",
49
+ label=_("View the Parent Zone belongs to"),
49
50
  )
50
51
  address_record_id = django_filters.ModelMultipleChoiceFilter(
51
52
  field_name="address_record",
52
53
  queryset=Record.objects.all(),
53
54
  to_field_name="id",
54
- label="Address Record",
55
+ label=_("Address Record"),
55
56
  )
56
57
  ptr_record_id = django_filters.ModelMultipleChoiceFilter(
57
58
  field_name="ptr_record",
58
59
  queryset=Record.objects.all(),
59
60
  to_field_name="id",
60
- label="Pointer Record",
61
+ label=_("Pointer Record"),
61
62
  )
62
63
  rfc2317_cname_record_id = django_filters.ModelMultipleChoiceFilter(
63
64
  field_name="rfc2317_cname_record",
64
65
  queryset=Record.objects.all(),
65
66
  to_field_name="id",
66
- label="Pointer Record",
67
+ label=_("Pointer Record"),
67
68
  )
68
69
  ipam_ip_address_id = django_filters.ModelMultipleChoiceFilter(
69
70
  field_name="ipam_ip_address",
70
71
  queryset=IPAddress.objects.all(),
71
72
  to_field_name="id",
72
- label="IPAM IP Address",
73
+ label=_("IPAM IP Address"),
73
74
  )
74
75
  ip_address = MultiValueCharFilter(
75
76
  method="filter_ip_address",
76
- label="IP Address",
77
+ label=_("IP Address"),
77
78
  )
78
79
 
79
80
  managed = django_filters.BooleanFilter()
@@ -1,5 +1,6 @@
1
1
  import django_filters
2
2
  from django.db.models import Q
3
+ from django.utils.translation import gettext as _
3
4
 
4
5
  from netbox.filtersets import NetBoxModelFilterSet
5
6
  from tenancy.filtersets import TenancyFilterSet
@@ -22,13 +23,13 @@ class RecordTemplateFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
22
23
  queryset=ZoneTemplate.objects.all(),
23
24
  field_name="zone_templates__name",
24
25
  to_field_name="name",
25
- label="Zone Template",
26
+ label=_("Zone Template"),
26
27
  )
27
28
  zone_template_id = django_filters.ModelMultipleChoiceFilter(
28
29
  queryset=ZoneTemplate.objects.all(),
29
30
  field_name="zone_templates",
30
31
  to_field_name="id",
31
- label="Zone Template ID",
32
+ label=_("Zone Template ID"),
32
33
  )
33
34
 
34
35
  class Meta:
@@ -1,6 +1,7 @@
1
1
  import django_filters
2
2
 
3
3
  from django.db.models import Q
4
+ from django.utils.translation import gettext as _
4
5
 
5
6
  from netbox.filtersets import NetBoxModelFilterSet
6
7
  from tenancy.filtersets import TenancyFilterSet
@@ -17,13 +18,13 @@ class ViewFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
17
18
  queryset=Prefix.objects.all(),
18
19
  field_name="prefixes",
19
20
  to_field_name="id",
20
- label="Prefixes ID",
21
+ label=_("Prefix ID"),
21
22
  )
22
23
  prefix = django_filters.ModelMultipleChoiceFilter(
23
24
  queryset=Prefix.objects.all(),
24
25
  field_name="prefixes__prefix",
25
26
  to_field_name="prefix",
26
- label="Prefix",
27
+ label=_("Prefix"),
27
28
  )
28
29
 
29
30
  class Meta: