diff --git a/atlas/migrations/0072_casedisplayset.py b/atlas/migrations/0072_casedisplayset.py new file mode 100644 index 00000000..cf2a1dd7 --- /dev/null +++ b/atlas/migrations/0072_casedisplayset.py @@ -0,0 +1,27 @@ +# Generated by Django 5.1.4 on 2025-06-30 12:03 + +import django.db.models.deletion +import generic.mixins +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0071_casedetail_default_viewerstate'), + ] + + operations = [ + migrations.CreateModel( + name='CaseDisplaySet', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(help_text='Name of the display set', max_length=255)), + ('description', models.TextField(blank=True, help_text='Description of the display set')), + ('viewerstate', models.JSONField(blank=True, help_text='Viewer state for the display set', null=True)), + ('annotations', models.JSONField(blank=True, help_text='Annotations for the display set', null=True)), + ('case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atlas.case')), + ], + bases=(models.Model, generic.mixins.AuthorMixin), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 5c17bd4e..98922574 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -1102,6 +1102,32 @@ class SeriesDetail(models.Model): class Meta: ordering = ("sort_order",) +class CaseDisplaySet(models.Model, AuthorMixin): + case = models.ForeignKey(Case, on_delete=models.CASCADE) + + name = models.CharField( + max_length=255, + help_text="Name of the display set", + ) + + description = models.TextField( + blank=True, + help_text="Description of the display set", + ) + + viewerstate = models.JSONField( + null=True, + blank=True, + help_text="Viewer state for the display set", + ) + + annotations = models.JSONField( + null=True, + blank=True, + help_text="Annotations for the display set", + ) + + class CaseDetail(models.Model): """A through table that stores the relationship between a case and a collection.