[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
collector

View file

@ -1,4 +1,4 @@
# Generated by Django 5.1.7 on 2025-03-12 21:29
# Generated by Django 5.1.7 on 2025-03-12 22:10
import django_extensions.db.fields
from django.db import migrations, models
@ -12,7 +12,7 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
name="Teile",
name="Teil",
fields=[
(
"id",
@ -32,7 +32,9 @@ class Migration(migrations.Migration):
),
],
options={
"indexes": [models.Index(fields=["modified"], name="modified")],
"verbose_name": "Teil",
"verbose_name_plural": "Teile",
"indexes": [models.Index(fields=["modified"], name="idx_modified")],
"constraints": [
models.UniqueConstraint(fields=("name",), name="unique_names")
],

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})"