bdd181425b
Docker Compose project with automated Playwright benchmarks comparing django-liveview 2.2.0 against Phoenix LiveView 1.0 across 6 scenarios.
23 lines
591 B
Python
23 lines
591 B
Python
from django.db import models
|
|
|
|
|
|
class Alert(models.Model):
|
|
TYPE_INFO = "INFO"
|
|
TYPE_WARNING = "WARNING"
|
|
TYPE_CRITICAL = "CRITICAL"
|
|
ALERT_TYPES = [
|
|
(TYPE_INFO, "Info"),
|
|
(TYPE_WARNING, "Warning"),
|
|
(TYPE_CRITICAL, "Critical"),
|
|
]
|
|
|
|
alert_type = models.CharField(max_length=10, choices=ALERT_TYPES, default=TYPE_INFO)
|
|
description = models.CharField(max_length=255)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
class Meta:
|
|
ordering = ["-id"]
|
|
|
|
def __str__(self):
|
|
return f"[{self.alert_type}] {self.description}"
|