From 8c1767884dedb6c87906265a2c35a3f1a6124a6e Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Tue, 14 Dec 2021 06:21:31 +0100 Subject: add __str__ method to chat model veiw --- chat_api/models.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chat_api') diff --git a/chat_api/models.py b/chat_api/models.py index 4b354f4..3be795a 100644 --- a/chat_api/models.py +++ b/chat_api/models.py @@ -17,6 +17,9 @@ class Group(models.Model): users = models.ManyToManyField(User, related_name="users_group") create_date = models.DateTimeField(auto_now=True) + def __str__(self): + return self.name + class Gm(models.Model): sender = models.ForeignKey(User, related_name="sender_gm", on_delete=models.CASCADE) reciever = models.ForeignKey(Group, related_name="receiver_gm", on_delete=models.CASCADE) -- cgit v1.2.3