trans: Translate models
This commit is contained in:
@@ -60,6 +60,10 @@ class Location(models.Model):
|
|||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Standort")
|
||||||
|
verbose_name_plural = _("Standorte")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.city and self.postcode:
|
if self.city and self.postcode:
|
||||||
return f"{self.city} ({self.postcode})"
|
return f"{self.city} ({self.postcode})"
|
||||||
@@ -103,6 +107,10 @@ class Location(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class ImportantLocation(models.Model):
|
class ImportantLocation(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Wichtiger Standort")
|
||||||
|
verbose_name_plural = _("Wichtige Standorte")
|
||||||
|
|
||||||
location = models.OneToOneField(Location, on_delete=models.CASCADE)
|
location = models.OneToOneField(Location, on_delete=models.CASCADE)
|
||||||
slug = models.SlugField(unique=True)
|
slug = models.SlugField(unique=True)
|
||||||
name = models.CharField(max_length=200)
|
name = models.CharField(max_length=200)
|
||||||
@@ -179,6 +187,8 @@ class RescueOrganization(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ('external_object_identifier', 'external_source_identifier',)
|
unique_together = ('external_object_identifier', 'external_source_identifier',)
|
||||||
ordering = ['name']
|
ordering = ['name']
|
||||||
|
verbose_name = _("Tierschutzorganisation")
|
||||||
|
verbose_name_plural = _("Tierschutzorganisationen")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.name}"
|
return f"{self.name}"
|
||||||
@@ -327,6 +337,10 @@ class Image(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.alt_text
|
return self.alt_text
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Bild")
|
||||||
|
verbose_name_plural = _("Bilder")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def as_html(self):
|
def as_html(self):
|
||||||
return f'<img src="{MEDIA_URL}/{self.image}" alt="{self.alt_text}">'
|
return f'<img src="{MEDIA_URL}/{self.image}" alt="{self.alt_text}">'
|
||||||
@@ -337,11 +351,11 @@ class AdoptionNotice(models.Model):
|
|||||||
permissions = [
|
permissions = [
|
||||||
("create_active_adoption_notice", "Can create an active adoption notice"),
|
("create_active_adoption_notice", "Can create an active adoption notice"),
|
||||||
]
|
]
|
||||||
|
verbose_name = _("Vermittlung")
|
||||||
|
verbose_name_plural = _("Vermittlungen")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if not hasattr(self, 'adoptionnoticestatus'):
|
return self.name
|
||||||
return self.name
|
|
||||||
return f"[{self.adoptionnoticestatus.as_string()}] {self.name}"
|
|
||||||
|
|
||||||
created_at = models.DateField(verbose_name=_('Erstellt am'), default=timezone.now)
|
created_at = models.DateField(verbose_name=_('Erstellt am'), default=timezone.now)
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
@@ -559,6 +573,10 @@ class AdoptionNoticeStatus(models.Model):
|
|||||||
whereas the minor status is used for reporting
|
whereas the minor status is used for reporting
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Vermittlungsstatus')
|
||||||
|
verbose_name_plural = _('Vermittlungsstati')
|
||||||
|
|
||||||
ACTIVE = "active"
|
ACTIVE = "active"
|
||||||
AWAITING_ACTION = "awaiting_action"
|
AWAITING_ACTION = "awaiting_action"
|
||||||
CLOSED = "closed"
|
CLOSED = "closed"
|
||||||
@@ -685,6 +703,10 @@ class SexChoicesWithAll(models.TextChoices):
|
|||||||
|
|
||||||
|
|
||||||
class Animal(models.Model):
|
class Animal(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Tier')
|
||||||
|
verbose_name_plural = _('Tiere')
|
||||||
|
|
||||||
date_of_birth = models.DateField(verbose_name=_('Geburtsdatum'))
|
date_of_birth = models.DateField(verbose_name=_('Geburtsdatum'))
|
||||||
name = models.CharField(max_length=200)
|
name = models.CharField(max_length=200)
|
||||||
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung'))
|
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung'))
|
||||||
@@ -750,6 +772,11 @@ class SearchSubscription(models.Model):
|
|||||||
- On new AdoptionNotice: Check all existing SearchSubscriptions for matches
|
- On new AdoptionNotice: Check all existing SearchSubscriptions for matches
|
||||||
- For matches: Send notification to user of the SearchSubscription
|
- For matches: Send notification to user of the SearchSubscription
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Abonnierte Suche")
|
||||||
|
verbose_name_plural = _("Abonnierte Suchen")
|
||||||
|
|
||||||
owner = models.ForeignKey(User, on_delete=models.CASCADE)
|
owner = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
location = models.ForeignKey(Location, on_delete=models.PROTECT, null=True)
|
location = models.ForeignKey(Location, on_delete=models.PROTECT, null=True)
|
||||||
sex = models.CharField(max_length=20, choices=SexChoicesWithAll.choices)
|
sex = models.CharField(max_length=20, choices=SexChoicesWithAll.choices)
|
||||||
@@ -768,6 +795,11 @@ class Rule(models.Model):
|
|||||||
"""
|
"""
|
||||||
Class to store rules
|
Class to store rules
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Regel")
|
||||||
|
verbose_name_plural = _("Regeln")
|
||||||
|
|
||||||
title = models.CharField(max_length=200)
|
title = models.CharField(max_length=200)
|
||||||
|
|
||||||
# Markdown is allowed in rule text
|
# Markdown is allowed in rule text
|
||||||
@@ -784,7 +816,8 @@ class Rule(models.Model):
|
|||||||
|
|
||||||
class Report(models.Model):
|
class Report(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = []
|
verbose_name = _("Meldung")
|
||||||
|
verbose_name_plural = _("Meldungen")
|
||||||
|
|
||||||
ACTION_TAKEN = "action taken"
|
ACTION_TAKEN = "action taken"
|
||||||
NO_ACTION_TAKEN = "no action taken"
|
NO_ACTION_TAKEN = "no action taken"
|
||||||
@@ -864,6 +897,10 @@ class ReportComment(Report):
|
|||||||
|
|
||||||
|
|
||||||
class ModerationAction(models.Model):
|
class ModerationAction(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Moderationsaktion")
|
||||||
|
verbose_name_plural = _("Moderationsaktionen")
|
||||||
|
|
||||||
BAN = "user_banned"
|
BAN = "user_banned"
|
||||||
DELETE = "content_deleted"
|
DELETE = "content_deleted"
|
||||||
COMMENT = "comment"
|
COMMENT = "comment"
|
||||||
@@ -928,6 +965,11 @@ class Announcement(Text):
|
|||||||
"""
|
"""
|
||||||
Class to store announcements that should be displayed for all users
|
Class to store announcements that should be displayed for all users
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Banner")
|
||||||
|
verbose_name_plural = _("Banner")
|
||||||
|
|
||||||
logged_in_only = models.BooleanField(default=False)
|
logged_in_only = models.BooleanField(default=False)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
@@ -977,6 +1019,11 @@ class Comment(models.Model):
|
|||||||
"""
|
"""
|
||||||
Class to store comments in markdown content
|
Class to store comments in markdown content
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Kommentar")
|
||||||
|
verbose_name_plural = _("Kommentare")
|
||||||
|
|
||||||
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name=_('Nutzer*in'))
|
user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name=_('Nutzer*in'))
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
@@ -996,6 +1043,10 @@ class Comment(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Notification(models.Model):
|
class Notification(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Benachrichtigung")
|
||||||
|
verbose_name_plural = _("Benachrichtigungen")
|
||||||
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
notification_type = models.CharField(max_length=200,
|
notification_type = models.CharField(max_length=200,
|
||||||
@@ -1039,6 +1090,12 @@ class Notification(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Subscriptions(models.Model):
|
class Subscriptions(models.Model):
|
||||||
|
"""Subscription to a AdoptionNotice"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Abonnement")
|
||||||
|
verbose_name_plural = _("Abonnements")
|
||||||
|
|
||||||
owner = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name=_('Nutzer*in'))
|
owner = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name=_('Nutzer*in'))
|
||||||
adoption_notice = models.ForeignKey(AdoptionNotice, on_delete=models.CASCADE, verbose_name=_('AdoptionNotice'))
|
adoption_notice = models.ForeignKey(AdoptionNotice, on_delete=models.CASCADE, verbose_name=_('AdoptionNotice'))
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
@@ -1066,6 +1123,11 @@ class Timestamp(models.Model):
|
|||||||
"""
|
"""
|
||||||
Class to store timestamps based on keys
|
Class to store timestamps based on keys
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Zeitstempel")
|
||||||
|
verbose_name_plural = _("Zeitstempel")
|
||||||
|
|
||||||
key = models.CharField(max_length=255, verbose_name=_("Schlüssel"), primary_key=True)
|
key = models.CharField(max_length=255, verbose_name=_("Schlüssel"), primary_key=True)
|
||||||
timestamp = models.DateTimeField(auto_now_add=True, verbose_name=_("Zeitstempel"))
|
timestamp = models.DateTimeField(auto_now_add=True, verbose_name=_("Zeitstempel"))
|
||||||
data = models.CharField(max_length=2000, blank=True, null=True)
|
data = models.CharField(max_length=2000, blank=True, null=True)
|
||||||
@@ -1078,6 +1140,11 @@ class SpeciesSpecificURL(models.Model):
|
|||||||
"""
|
"""
|
||||||
Model that allows to specify a URL for a rescue organization where a certain species can be found
|
Model that allows to specify a URL for a rescue organization where a certain species can be found
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _("Tierartspezifische URL")
|
||||||
|
verbose_name_plural = _("Tierartspezifische URLs")
|
||||||
|
|
||||||
species = models.ForeignKey(Species, on_delete=models.CASCADE, verbose_name=_("Tierart"))
|
species = models.ForeignKey(Species, on_delete=models.CASCADE, verbose_name=_("Tierart"))
|
||||||
rescue_organization = models.ForeignKey(RescueOrganization, on_delete=models.CASCADE,
|
rescue_organization = models.ForeignKey(RescueOrganization, on_delete=models.CASCADE,
|
||||||
verbose_name=_("Tierschutzorganisation"))
|
verbose_name=_("Tierschutzorganisation"))
|
||||||
|
Reference in New Issue
Block a user