From 4fd90257df0994f05287e1cb2c56c7801faf0861 Mon Sep 17 00:00:00 2001 From: Bryan Hilbert Date: Mon, 2 Dec 2024 17:19:57 -0500 Subject: [PATCH] Add enum-related imports --- jwql/website/apps/jwql/monitor_models/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jwql/website/apps/jwql/monitor_models/common.py b/jwql/website/apps/jwql/monitor_models/common.py index 18a514675..f8c3aa0f8 100644 --- a/jwql/website/apps/jwql/monitor_models/common.py +++ b/jwql/website/apps/jwql/monitor_models/common.py @@ -176,9 +176,11 @@ class Meta: # Feel free to rename the models, but don't rename db_table values or field names. from django.db import models from django.contrib.postgres.fields import ArrayField +from django_enum import EnumField +from enum import StrEnum -class StatusEnum(models.TextChoices): +class StatusEnum(StrEnum): SUCCESS = "SUCCESS" FAILURE = "FAILURE" @@ -187,7 +189,7 @@ class Monitor(models.Model): monitor_name = models.CharField() start_time = models.DateTimeField() end_time = models.DateTimeField(blank=True, null=True) - status = models.EnumField(StatusEnum) + status = EnumField(StatusEnum) log_file = models.CharField() class Meta: