Skip to content

Commit

Permalink
Added str model
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Jan 22, 2021
1 parent 980b50a commit 99b9594
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions weni/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit 99b9594

Please sign in to comment.