Closes #13352: Translation support for model verbose names (#13354)

* Update verbose_name & verbose_name_plural Meta attributes on all models

* Alter makemigrations to ignore verbose_name & verbose_name_plural changes
This commit is contained in:
Jeremy Stretch
2023-08-03 10:41:10 -04:00
committed by GitHub
parent 24ffaf09d4
commit caedc8dbe3
36 changed files with 288 additions and 28 deletions

View File

@@ -91,6 +91,8 @@ class Cable(PrimaryModel):
class Meta:
ordering = ('pk',)
verbose_name = _('cable')
verbose_name_plural = _('cables')
def __init__(self, *args, a_terminations=None, b_terminations=None, **kwargs):
super().__init__(*args, **kwargs)
@@ -292,6 +294,8 @@ class CableTermination(ChangeLoggedModel):
name='%(app_label)s_%(class)s_unique_termination'
),
)
verbose_name = _('cable termination')
verbose_name_plural = _('cable terminations')
def __str__(self):
return f'Cable {self.cable} to {self.termination}'
@@ -427,6 +431,10 @@ class CablePath(models.Model):
)
_nodes = PathField()
class Meta:
verbose_name = _('cable path')
verbose_name_plural = _('cable paths')
def __str__(self):
return f"Path #{self.pk}: {len(self.path)} hops"