Add WIP
This commit is contained in:
core
admin.py
migrations
0001_initial.py0002_remove_discordsetting_notification_type_and_more.py0003_subscription.py0004_historicaldiscordsetting_historicalsubscription.py0005_discordsetting_created_at_and_more.py
models.pytemplates
views
twitch_app
admin.pyapi.py
management
commands
migrations
0001_initial.py0002_game_image_url.py0003_historicaldropbenefit_historicaldropcampaign_and_more.py0004_remove_user_drop_campaigns_delete_historicaluser_and_more.py0005_alter_dropbenefit_options_alter_dropcampaign_options_and_more.py0006_alter_dropbenefit_options_alter_dropcampaign_options_and_more.py0007_alter_dropcampaign_time_based_drops_and_more.py0008_alter_dropbenefit_game_and_more.py
models.py@ -1,26 +0,0 @@
|
||||
from typing import Literal
|
||||
|
||||
import auto_prefetch
|
||||
from django.db import models
|
||||
from simple_history.models import HistoricalRecords
|
||||
|
||||
from twitch_app.models import Game
|
||||
|
||||
|
||||
class Webhook(auto_prefetch.Model):
|
||||
"""Webhooks to send notifications to."""
|
||||
|
||||
url = models.URLField(unique=True)
|
||||
game = models.ForeignKey(Game, on_delete=models.CASCADE)
|
||||
disabled = models.BooleanField(default=False)
|
||||
added_at = models.DateTimeField(blank=True, null=True, auto_now_add=True)
|
||||
modified_at = models.DateTimeField(blank=True, null=True, auto_now=True)
|
||||
history = HistoricalRecords()
|
||||
|
||||
class Meta(auto_prefetch.Model.Meta):
|
||||
verbose_name: str = "Webhook"
|
||||
verbose_name_plural: str = "Webhooks"
|
||||
ordering: tuple[Literal["url"]] = ("url",)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.url
|
Reference in New Issue
Block a user