class User(models.Model): telegram_id = models.CharField(max_length=20) twitch_id = models.CharField(max_length=20) twitch_bearer = models.CharField(max_length=30) twitch_refresh_token = models.CharField(max_length=50) created = models.DateTimeField(auto_now_add=True) def str(self): return f'USER {self.twitch_id}' class Chat(models.Model): broadcaster = models.ForeignKey(User, on_delete=models.CASCADE) nickname = models.CharField(max_length=10) chat_id = models.CharField(max_length=30) shelf_life = models.DateField() created = models.DateTimeField(auto_now_add=True) def str(self): return f'CHAT {self.nickname}'
В классе Chat свойство broadcaster
Обсуждают сегодня