1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13149: Wrap form field labels with gettext_lazy()

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2023-07-31 23:52:38 +07:00
committed by GitHub
parent 83bebc1bd2
commit b7a9649269
51 changed files with 1381 additions and 601 deletions

View File

@@ -1,4 +1,4 @@
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy as _
from dcim.choices import LinkStatusChoices
from dcim.models import Interface
@@ -18,6 +18,7 @@ __all__ = (
class WirelessLANGroupImportForm(NetBoxModelImportForm):
parent = CSVModelChoiceField(
label=_('Parent'),
queryset=WirelessLANGroup.objects.all(),
required=False,
to_field_name='name',
@@ -32,33 +33,39 @@ class WirelessLANGroupImportForm(NetBoxModelImportForm):
class WirelessLANImportForm(NetBoxModelImportForm):
group = CSVModelChoiceField(
label=_('Group'),
queryset=WirelessLANGroup.objects.all(),
required=False,
to_field_name='name',
help_text=_('Assigned group')
)
status = CSVChoiceField(
label=_('Status'),
choices=WirelessLANStatusChoices,
help_text='Operational status'
)
vlan = CSVModelChoiceField(
label=_('VLAN'),
queryset=VLAN.objects.all(),
required=False,
to_field_name='name',
help_text=_('Bridged VLAN')
)
tenant = CSVModelChoiceField(
label=_('Tenant'),
queryset=Tenant.objects.all(),
required=False,
to_field_name='name',
help_text=_('Assigned tenant')
)
auth_type = CSVChoiceField(
label=_('Authentication type'),
choices=WirelessAuthTypeChoices,
required=False,
help_text=_('Authentication type')
)
auth_cipher = CSVChoiceField(
label=_('Authentication cipher'),
choices=WirelessAuthCipherChoices,
required=False,
help_text=_('Authentication cipher')
@@ -74,27 +81,33 @@ class WirelessLANImportForm(NetBoxModelImportForm):
class WirelessLinkImportForm(NetBoxModelImportForm):
status = CSVChoiceField(
label=_('Status'),
choices=LinkStatusChoices,
help_text=_('Connection status')
)
interface_a = CSVModelChoiceField(
label=_('Interface A'),
queryset=Interface.objects.all()
)
interface_b = CSVModelChoiceField(
label=_('Interface B'),
queryset=Interface.objects.all()
)
tenant = CSVModelChoiceField(
label=_('Tenant'),
queryset=Tenant.objects.all(),
required=False,
to_field_name='name',
help_text=_('Assigned tenant')
)
auth_type = CSVChoiceField(
label=_('Authentication type'),
choices=WirelessAuthTypeChoices,
required=False,
help_text=_('Authentication type')
)
auth_cipher = CSVChoiceField(
label=_('Authentication cipher'),
choices=WirelessAuthCipherChoices,
required=False,
help_text=_('Authentication cipher')