vbv/server/vbv_lernwelt/notify/models.py

29 lines
931 B
Python

import uuid
from django.db import models
from django.utils.translation import gettext_lazy as _
from notifications.base.models import AbstractNotification
class NotificationType(models.TextChoices):
USER_INTERACTION = "USER_INTERACTION", _("User Interaction")
PROGRESS = "PROGRESS", _("Progress")
INFORMATION = "INFORMATION", _("Information")
class Notification(AbstractNotification):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
notification_type = models.CharField(
max_length=32,
choices=NotificationType.choices,
default=NotificationType.INFORMATION,
)
target_url = models.URLField(blank=True, null=True)
actor_avatar_url = models.URLField(blank=True, null=True)
course = models.CharField(max_length=32, blank=True, null=True)
class Meta(AbstractNotification.Meta):
abstract = False
ordering = ["-timestamp"]