From 15279ee99cd05d77fc866839259c02a837efd9ac Mon Sep 17 00:00:00 2001
From: bronsen <kontakt+gitcommit@nrrd.de>
Date: Wed, 12 Mar 2025 23:11:58 +0100
Subject: [PATCH] [collector] rename model to singular form, but provide
 verbose_name* in Meta

---
 collector/migrations/0001_initial.py | 8 +++++---
 collector/models.py                  | 5 ++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/collector/migrations/0001_initial.py b/collector/migrations/0001_initial.py
index 0667a7b..54bd1c0 100644
--- a/collector/migrations/0001_initial.py
+++ b/collector/migrations/0001_initial.py
@@ -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")
                 ],
diff --git a/collector/models.py b/collector/models.py
index 70cdcb5..500b69a 100644
--- a/collector/models.py
+++ b/collector/models.py
@@ -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})"