diff --git a/app/notification/models/base.py b/app/notification/models/base.py index 8cad6d9..2379f9a 100644 --- a/app/notification/models/base.py +++ b/app/notification/models/base.py @@ -76,6 +76,9 @@ class Meta: ), ] + def __str__(self) -> str: + return f"[{self.code}] {self.title}" + @classmethod def _to_dtl(cls, source: str) -> str: return source @@ -153,6 +156,9 @@ class NotificationHistoryBase(BaseAbstractModel): class Meta: abstract = True + def __str__(self) -> str: + return f"{self.template_code or '-'} by {self.created_by}" + @property def template_code(self) -> str: return self.template.code if self.template_id else "" @@ -212,6 +218,9 @@ class Meta: ), ] + def __str__(self) -> str: + return f"{self.recipient} ({self.get_status_display()})" + def _parsed_template_data(self) -> Any: try: return json_loads(self.history.template_data)