From 99b9594d59e5783bdba4fb8e89b836531036ea0b Mon Sep 17 00:00:00 2001 From: Daniel Yohan Date: Fri, 22 Jan 2021 12:18:33 -0300 Subject: [PATCH] Added str model --- weni/common/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/weni/common/models.py b/weni/common/models.py index d3125f70..3610b4a5 100644 --- a/weni/common/models.py +++ b/weni/common/models.py @@ -14,6 +14,9 @@ class Meta: description = models.TextField(_("description")) created_at = models.DateTimeField(_("created at"), auto_now_add=True) + def __str__(self): + return self.title + class Service(models.Model): class Meta: @@ -26,6 +29,9 @@ class Meta: last_updated = models.DateTimeField(_("last updated"), auto_now_add=True) default = models.BooleanField(_("service default"), default=False) + def __str__(self): + return self.url + class ServiceStatus(models.Model): class Meta: @@ -37,6 +43,9 @@ class Meta: user = models.ForeignKey(User, models.CASCADE, related_name="service_status") created_at = models.DateTimeField(_("created at"), auto_now_add=True) + def __str__(self): + return self.service.url + @receiver(post_save, sender=User) def create_service_status(sender, instance, created, **kwargs):