22 lines
665 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.db import models
class Anomaly(models.Model):
timestamp = models.DateTimeField()
confidence = models.PositiveSmallIntegerField(
help_text="Уверенность в аномалии (от 0 до 100%)"
)
def __str__(self):
return f"{self.timestamp} — Уверенность: {self.confidence}%"
class LevelHistory(models.Model):
timestamp = models.DateTimeField()
level_percent = models.PositiveSmallIntegerField(
help_text="Уровень жидкости в процентах (0–100)",
)
def __str__(self):
return f"{self.timestamp} — Уровень: {self.level_percent}%"