From ed99be3afba8518987caf51223570d2e250a9627 Mon Sep 17 00:00:00 2001 From: Joachim Jablon Date: Thu, 8 Aug 2024 23:48:56 +0200 Subject: [PATCH] Add __str__ for events too --- procrastinate/contrib/django/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/procrastinate/contrib/django/models.py b/procrastinate/contrib/django/models.py index 97194b709..23206d710 100644 --- a/procrastinate/contrib/django/models.py +++ b/procrastinate/contrib/django/models.py @@ -130,6 +130,9 @@ class Meta: # type: ignore db_table = "procrastinate_events" get_latest_by = "at" + def __str__(self) -> str: + return f"Event {self.id} - Job {self.job_id}: {self.type} at {self.at}" # type: ignore + class ProcrastinatePeriodicDefer(ProcrastinateReadOnlyModelMixin, models.Model): id = models.BigAutoField(primary_key=True)