mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-05 14:56:24 -06:00
10300 initial translation support use gettext
This commit is contained in:
@@ -10,6 +10,7 @@ from django.db import models
|
||||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext as _
|
||||
from netaddr import IPNetwork
|
||||
|
||||
from ipam.fields import IPNetworkField
|
||||
@@ -216,7 +217,7 @@ class Token(models.Model):
|
||||
)
|
||||
write_enabled = models.BooleanField(
|
||||
default=True,
|
||||
help_text='Permit create/update/delete operations using this key'
|
||||
help_text=_('Permit create/update/delete operations using this key')
|
||||
)
|
||||
description = models.CharField(
|
||||
max_length=200,
|
||||
@@ -227,8 +228,8 @@ class Token(models.Model):
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name='Allowed IPs',
|
||||
help_text='Allowed IPv4/IPv6 networks from where the token can be used. Leave blank for no restrictions. '
|
||||
'Ex: "10.1.1.0/24, 192.168.10.16/32, 2001:DB8:1::/64"',
|
||||
help_text=_('Allowed IPv4/IPv6 networks from where the token can be used. Leave blank for no restrictions. '
|
||||
'Ex: "10.1.1.0/24, 192.168.10.16/32, 2001:DB8:1::/64"'),
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
@@ -304,12 +305,12 @@ class ObjectPermission(models.Model):
|
||||
)
|
||||
actions = ArrayField(
|
||||
base_field=models.CharField(max_length=30),
|
||||
help_text="The list of actions granted by this permission"
|
||||
help_text=_("The list of actions granted by this permission")
|
||||
)
|
||||
constraints = models.JSONField(
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text="Queryset filter matching the applicable objects of the selected type(s)"
|
||||
help_text=_("Queryset filter matching the applicable objects of the selected type(s)")
|
||||
)
|
||||
|
||||
objects = RestrictedQuerySet.as_manager()
|
||||
|
||||
Reference in New Issue
Block a user