10300 initial translation support use gettext

This commit is contained in:
Arthur
2022-11-03 11:58:26 -07:00
committed by Jeremy Stretch
parent 2cc2d2cc37
commit 6eba5d4d96
67 changed files with 1192 additions and 1134 deletions
+6 -5
View File
@@ -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()