summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chat_api/models.py3
1 files changed, 3 insertions, 0 deletions
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):
17 users = models.ManyToManyField(User, related_name="users_group") 17 users = models.ManyToManyField(User, related_name="users_group")
18 create_date = models.DateTimeField(auto_now=True) 18 create_date = models.DateTimeField(auto_now=True)
19 19
20 def __str__(self):
21 return self.name
22
20class Gm(models.Model): 23class Gm(models.Model):
21 sender = models.ForeignKey(User, related_name="sender_gm", on_delete=models.CASCADE) 24 sender = models.ForeignKey(User, related_name="sender_gm", on_delete=models.CASCADE)
22 reciever = models.ForeignKey(Group, related_name="receiver_gm", on_delete=models.CASCADE) 25 reciever = models.ForeignKey(Group, related_name="receiver_gm", on_delete=models.CASCADE)