[collector] rename model to singular form, but provide verbose_name* in Meta

This commit is contained in:
bronsen 2025-03-12 23:11:58 +01:00
parent 77c67c637c
commit 15279ee99c
2 changed files with 9 additions and 4 deletions

View file

@ -2,7 +2,7 @@ from django.db import models
from django_extensions.db.models import ModificationDateTimeField
class Teile(models.Model):
class Teil(models.Model):
name = models.TextField("Name of the part", null=False, blank=False)
modified = ModificationDateTimeField("last changed")
@ -14,6 +14,9 @@ class Teile(models.Model):
models.Index(fields=["modified"], name="idx_modified"),
]
verbose_name = "Teil"
verbose_name_plural = "Teile"
def __str__(self) -> str:
modified = self.modified.isoformat(timespec="seconds")
return f"{self.name} (last change: {modified})"