From f8bc3b574d51d9782beeb87609f58e161c8805b2 Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 13 Aug 2020 16:51:53 +0530 Subject: Add string representation in teams model --- teams/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/teams/models.py b/teams/models.py index b0f6fe4..ed91f73 100644 --- a/teams/models.py +++ b/teams/models.py @@ -4,6 +4,9 @@ from django.contrib.auth.models import User from workshop_app.models import Profile class Team(models.Model): - members = models.ManyToManyField(Profile) - creator = models.OneToOneField(User, on_delete=models.CASCADE) - created_date = models.DateTimeField(auto_now=True) \ No newline at end of file + members = models.ManyToManyField(Profile) + creator = models.OneToOneField(User, on_delete=models.CASCADE) + created_date = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"Team created by {self.creator.get_full_name()}" -- cgit