[collector] rename model to singular form, but provide verbose_name* in Meta
This commit is contained in:
parent
77c67c637c
commit
15279ee99c
2 changed files with 9 additions and 4 deletions
|
|
@ -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})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue