diff options
author | adityacp | 2020-08-13 16:51:53 +0530 |
---|---|---|
committer | adityacp | 2020-08-13 16:51:53 +0530 |
commit | f8bc3b574d51d9782beeb87609f58e161c8805b2 (patch) | |
tree | b924edd2eba060ff59974d73a84b7e0758bb8907 | |
parent | 4fb30bc7dc02a4ca17aec13ca83d2d23fe9ae632 (diff) | |
download | workshop_booking-f8bc3b574d51d9782beeb87609f58e161c8805b2.tar.gz workshop_booking-f8bc3b574d51d9782beeb87609f58e161c8805b2.tar.bz2 workshop_booking-f8bc3b574d51d9782beeb87609f58e161c8805b2.zip |
Add string representation in teams model
-rw-r--r-- | teams/models.py | 9 |
1 files 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()}" |