feat: nicer AN name
This commit is contained in:
parent
227fa4d5a8
commit
3c286d84d8
@ -180,7 +180,9 @@ class AdoptionNotice(models.Model):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.name}"
|
if not hasattr(self, 'adoptionnoticestatus'):
|
||||||
|
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)
|
||||||
last_checked = models.DateTimeField(verbose_name=_('Zuletzt überprüft am'), default=timezone.now)
|
last_checked = models.DateTimeField(verbose_name=_('Zuletzt überprüft am'), default=timezone.now)
|
||||||
@ -362,6 +364,9 @@ class AdoptionNoticeStatus(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.adoption_notice}: {self.major_status}, {self.minor_status}"
|
return f"{self.adoption_notice}: {self.major_status}, {self.minor_status}"
|
||||||
|
|
||||||
|
def as_string(self):
|
||||||
|
return f"{self.major_status}, {self.minor_status}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
return self.major_status == self.ACTIVE
|
return self.major_status == self.ACTIVE
|
||||||
|
Loading…
Reference in New Issue
Block a user