Simone Robutti 2c8063cf4a
rename everything (#50)
* fixed visualization

* simplified tests

* split into files

* refactored test expected publications

* split update tests

* expanded specifications and tests

* added event_status window tests

* fixed 'all' command

* renamed everything

* fixed uppercase
2021-08-16 10:49:52 +02:00

33 lines
693 B
Python

from enum import IntEnum
from tortoise import fields
from tortoise.models import Model
class NotificationStatus(IntEnum):
WAITING = 1
FAILED = 2
PARTIAL = 3
COMPLETED = 4
class Notification(Model):
id = fields.UUIDField(pk=True)
status = fields.IntEnumField(NotificationStatus)
message = fields.TextField()
target = fields.ForeignKeyField(
"models.Publisher", related_name="notifications", null=True
)
publication = fields.ForeignKeyField(
"models.Publication", related_name="notifications", null=True
)
def __str__(self):
return f"[{self.status}] {self.message}"
class Meta:
table = "notification"