Skip to content

Commit

Permalink
Add enum-related imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Dec 2, 2024
1 parent b299c0f commit 4fd9025
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jwql/website/apps/jwql/monitor_models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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:
Expand Down

0 comments on commit 4fd9025

Please sign in to comment.