diff --git a/jwql/website/apps/jwql/migrations/0028_alter_filesystemcharacteristics_filter_pupil_and_more.py b/jwql/website/apps/jwql/migrations/0028_alter_filesystemcharacteristics_filter_pupil_and_more.py index 2e4e04a7d..7e6fb3dd3 100644 --- a/jwql/website/apps/jwql/migrations/0028_alter_filesystemcharacteristics_filter_pupil_and_more.py +++ b/jwql/website/apps/jwql/migrations/0028_alter_filesystemcharacteristics_filter_pupil_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1 on 2024-11-13 14:56 +# Generated by Django 5.1.4 on 2025-01-16 21:35 import django.contrib.postgres.fields from django.db import migrations, models @@ -16,9 +16,24 @@ class Migration(migrations.Migration): name='filter_pupil', field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(default='empty', help_text='filter and/or pupil name', max_length=7), blank=True, null=True, size=None), ), + migrations.AlterField( + model_name='filesystemcharacteristics', + name='instrument', + field=models.CharField(), + ), migrations.AlterField( model_name='filesystemcharacteristics', name='obs_per_filter_pupil', field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None), ), + migrations.AlterField( + model_name='filesysteminstrument', + name='filetype', + field=models.CharField(), + ), + migrations.AlterField( + model_name='filesysteminstrument', + name='instrument', + field=models.CharField(default='empty', help_text='JWST instrument name', max_length=7), + ), ] diff --git a/jwql/website/apps/jwql/monitor_models/common.py b/jwql/website/apps/jwql/monitor_models/common.py index 47c01f8b9..ee6da326e 100644 --- a/jwql/website/apps/jwql/monitor_models/common.py +++ b/jwql/website/apps/jwql/monitor_models/common.py @@ -177,25 +177,19 @@ 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 -from jwql.utils.constants import DEFAULT_MODEL_CHARFIELD, MAX_LEN_FILTER, FILE_SUFFIX_TYPES +from jwql.utils.constants import ( + DEFAULT_MODEL_CHARFIELD, + MAX_LEN_FILTER, + MAX_LEN_INSTRUMENT, +) -FILE_SUFFIX_CLASS = StrEnum('FILE_SUFFIX_CLASS', FILE_SUFFIX_TYPES) - -class InstrumentEnum(StrEnum): - FGS_TYPE = "fgs" - MIRI_TYPE = "miri" - NIRCAM_TYPE = "nircam" - NIRISS_TYPE = "niriss" - NIRSPEC_TYPE = "nirspec" class Monitor(models.Model): monitor_name = models.CharField() start_time = models.DateTimeField() end_time = models.DateTimeField(blank=True, null=True) - status = models.TextField(blank=True, null=True) # This field type is a guess. + status = models.TextField(blank=True, null=True) log_file = models.CharField() class Meta: @@ -217,7 +211,7 @@ class Meta: class FilesystemCharacteristics(models.Model): date = models.DateTimeField() - instrument = EnumField(InstrumentEnum) # This field type is a guess. + instrument = models.CharField() filter_pupil = ArrayField( models.CharField( max_length=MAX_LEN_FILTER, @@ -254,8 +248,12 @@ class Meta: class FilesystemInstrument(models.Model): date = models.DateTimeField() - instrument = EnumField(InstrumentEnum) # This field type is a guess. - filetype = EnumField(FILE_SUFFIX_CLASS) # This field type is a guess. + instrument = models.CharField( + max_length=MAX_LEN_INSTRUMENT, + help_text="JWST instrument name", + default=DEFAULT_MODEL_CHARFIELD, + ) + filetype = models.CharField() count = models.IntegerField() size = models.FloatField()