Ajout de l'application discord_integration avec modèles, migrations, logique d'annonces et gestion des rôles dans Discord.
This commit is contained in:
parent
1354568495
commit
2ec4a5c065
18 changed files with 239 additions and 6 deletions
13
discord_integration/models.py
Normal file
13
discord_integration/models.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.db import models
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
class DiscordNotification(models.Model):
|
||||
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = GenericForeignKey('content_type', 'object_id')
|
||||
is_announced = models.BooleanField(default=False)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"Annonces pour {self.content_object} ({'✅' if self.is_announced else '⏳'})"
|
||||
Loading…
Add table
Add a link
Reference in a new issue