Quiz
1from django.db import models2from authapp.models import AuthUser3from games.models import Game, Lobby4
5class FriendMessage(models.Model):6
7sender = models.ForeignKey(AuthUser, on_delete=models.CASCADE, related_name='sender')8receiver = models.ForeignKey(AuthUser, on_delete=models.CASCADE, related_name='receiver')9text = models.CharField(max_length=128)10created_at = models.DateTimeField(auto_now=True)11
12class LobbyMessage(models.Model):13
14sender = models.ForeignKey(AuthUser, on_delete=models.CASCADE)15lobby = models.ForeignKey(Lobby, on_delete=models.CASCADE)16text = models.CharField(max_length=128)17created_at = models.DateTimeField(auto_now=True)18
19class GameMessage(models.Model):20
21sender = models.ForeignKey(AuthUser, on_delete=models.CASCADE)22game = models.ForeignKey(Game, on_delete=models.CASCADE)23text = models.CharField(max_length=128)24created_at = models.DateTimeField(auto_now=True)25
26