Improve admin page
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
from twitch_app.models import Game
|
||||
|
||||
@ -8,6 +9,7 @@ class DiscordSetting(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=255)
|
||||
webhook_url = models.URLField()
|
||||
history = HistoricalRecords()
|
||||
disabled = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self) -> str:
|
||||
@ -18,6 +20,7 @@ class Subscription(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
game = models.ForeignKey(Game, on_delete=models.CASCADE)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
history = HistoricalRecords()
|
||||
discord_webhook = models.ForeignKey(DiscordSetting, on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
Reference in New Issue
Block a user