konova/news/models.py
mipel 04db4e4e7f Fixes and improvements
* moves diff_states message back to table top for direct presentation in compensation/detail/view.html
* removes diff_states rendering in deadline card in compensation/detail/view.html
* fixes before_state adding based on GET parameter
* refactors UserActionlogEntryEnum into a UserAction TextChoice (Django 3.x)
* adds ordering of compensation states depending on surface value
* refactors ServerMessageImportance from enum into TextChoice (Django 3.x)
* adds/updates translations
2021-08-03 17:22:41 +02:00

26 lines
793 B
Python

from django.db import models
from django.utils.translation import gettext_lazy as _
from konova.models import BaseResource
class ServerMessageImportance(models.TextChoices):
"""
Defines importance levels for server messages
"""
DEFAULT = "default", _("Default")
INFO = "info", _("Info")
WARNING = "warning", _("Warning")
class ServerMessage(BaseResource):
"""
Holds messages, which can be displayed on the user's dashboard
"""
subject = models.CharField(max_length=500, null=False, blank=False)
body = models.TextField()
is_active = models.BooleanField(default=True)
publish_on = models.DateTimeField()
unpublish_on = models.DateTimeField()
importance = models.CharField(max_length=100, choices=ServerMessageImportance.choices)