diff --git a/input/migrations/0105_add_verbose_names.py b/input/migrations/0105_add_verbose_names.py new file mode 100644 index 0000000..0327cf7 --- /dev/null +++ b/input/migrations/0105_add_verbose_names.py @@ -0,0 +1,57 @@ +# Generated by Django 5.2.5 on 2025-11-07 15:26 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0104_alter_project_required_fields'), + ] + + operations = [ + migrations.AlterModelOptions( + name='account', + options={'verbose_name': 'Kostenstelle', 'verbose_name_plural': 'Kostenstellen'}, + ), + migrations.AlterModelOptions( + name='businesscard', + options={'verbose_name': 'Visitenkarte', 'verbose_name_plural': 'Visitenkarten'}, + ), + migrations.AlterModelOptions( + name='eliterature', + options={'verbose_name': 'eLiteraturstipendium', 'verbose_name_plural': 'eLiteraturstipendien'}, + ), + migrations.AlterModelOptions( + name='email', + options={'verbose_name': 'E-Mail-Adresse', 'verbose_name_plural': 'E-Mail-Adressen'}, + ), + migrations.AlterModelOptions( + name='honorarycertificate', + options={'verbose_name': 'Bescheinigung', 'verbose_name_plural': 'Bescheinigungen'}, + ), + migrations.AlterModelOptions( + name='ifg', + options={'verbose_name': 'IFG-Anfrage', 'verbose_name_plural': 'IFG-Anfragen'}, + ), + migrations.AlterModelOptions( + name='library', + options={'verbose_name': 'Bibliotheksstipendium', 'verbose_name_plural': 'Bibliotheksstipendien'}, + ), + migrations.AlterModelOptions( + name='list', + options={'verbose_name': 'Mailingliste', 'verbose_name_plural': 'Mailinglisten'}, + ), + migrations.AlterModelOptions( + name='literature', + options={'verbose_name': 'Literaturstipendium', 'verbose_name_plural': 'Literaturstipendien'}, + ), + migrations.AlterModelOptions( + name='software', + options={'verbose_name': 'Softwarestipendium', 'verbose_name_plural': 'Softwarestipendien'}, + ), + migrations.AlterModelOptions( + name='travel', + options={'verbose_name': 'Reisekosten', 'verbose_name_plural': 'Reisekosten'}, + ), + ] diff --git a/input/models.py b/input/models.py index 5fd8474..9ad08ef 100755 --- a/input/models.py +++ b/input/models.py @@ -100,6 +100,10 @@ class Account(models.Model): description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION') intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'Kostenstelle' + verbose_name_plural = 'Kostenstellen' + def __str__(self): return f'{self.code} {self.description}' @@ -347,8 +351,12 @@ class HonoraryCertificate(Intern): project = models.ForeignKey(Project, null=True, blank=True, on_delete=models.SET_NULL) + class Meta: + verbose_name = 'Bescheinigung' + verbose_name_plural = 'Bescheinigungen' + def __str__(self): - return f'Certificate for {self.realname}' + return f'Bescheinigung für {self.realname}' TRANSPORT_CHOICES = { @@ -387,6 +395,13 @@ class Travel(Extern): # use content type model to get the end date for the project foreign key project_end_quartal = models.CharField(max_length=15, null=True, blank=True, verbose_name='Quartal Projekt Ende') + class Meta: + verbose_name = 'Reisekosten' + verbose_name_plural = 'Reisekosten' + + def __str__(self): + return f'Reisekosten für {self.realname}' + def clean(self): if (self.checkin and self.checkout) and (self.checkout < self.checkin): raise forms.ValidationError({ @@ -451,6 +466,10 @@ class Library(Grant): duration = models.CharField(max_length=100, verbose_name='Dauer') intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'Bibliotheksstipendium' + verbose_name_plural = 'Bibliotheksstipendien' + def __str__(self): return self.library @@ -468,6 +487,8 @@ class ELiterature(Library): class Meta: proxy = True + verbose_name = 'eLiteraturstipendium' + verbose_name_plural = 'eLiteraturstipendien' class Software(Library): @@ -478,6 +499,8 @@ class Software(Library): class Meta: proxy = True + verbose_name = 'Softwarestipendium' + verbose_name_plural = 'Softwarestipendien' SELFBUY_CHOICES = { @@ -500,14 +523,22 @@ class Literature(TermsConsentMixin, Grant): Telefonnummer, E-Mail-Adresse usw.). Trenne die einzelnen Angaben durch Zeilenumbrüche.')) intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'Literaturstipendium' + verbose_name_plural = 'Literaturstipendien' + class IFG(Grant): url = models.URLField(max_length=2000, verbose_name='URL', help_text='Bitte gib den Link zu deiner Anfrage bei Frag den Staat an.') intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'IFG-Anfrage' + verbose_name_plural = 'IFG-Anfragen' + def __str__(self): - return 'IFG-Anfrage von ' + self.realname + return f'IFG-Anfrage von {self.realname}' DOMAIN_CHOICES = { @@ -550,6 +581,10 @@ class Email(TermsConsentMixin, Domain): adult = models.CharField(max_length=10, verbose_name='Volljährigkeit', choices=ADULT_CHOICES.items(), default='FALSE') intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'E-Mail-Adresse' + verbose_name_plural = 'E-Mail-Adressen' + class List(TermsConsentMixin, Domain): address = models.CharField(max_length=50, default='NO_ADDRESS', @@ -557,6 +592,10 @@ class List(TermsConsentMixin, Domain): help_text=mark_safe('Bitte gib hier den gewünschten Adressbestandteil an,
der sich vor der Domain befinden soll.')) intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'Mailingliste' + verbose_name_plural = 'Mailinglisten' + PROJECT_CHOICE = { 'PEDIA': 'Wikipedia', @@ -601,6 +640,10 @@ class BusinessCard(RequestUrlMixin, TermsConsentMixin, Extern): send_data_to_print = models.BooleanField(default=False, verbose_name=mark_safe('Datenweitergabe erlauben'), help_text=mark_safe('Hiermit erlaube ich die Weitergabe meiner Daten (Name, Postadresse) an den von Wikimedia
Deutschland ausgewählten Dienstleister (z. B. wir-machen-druck.de) zum Zwecke des direkten
Versands der Druckerzeugnisse an mich.')) intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') + class Meta: + verbose_name = 'Visitenkarte' + verbose_name_plural = 'Visitenkarten' + MODELS = { TYPE_BIB: Library,