From 15971a867c350c2100ab9d4bc860684bbacacfb0 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 31 Mar 2022 22:31:19 +0100 Subject: [PATCH] . --- atlas/migrations/0030_auto_20220331_2224.py | 27 +++++++++++++++++++ ...31_alter_casecollection_collection_type.py | 18 +++++++++++++ atlas/models.py | 10 +++++-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 atlas/migrations/0030_auto_20220331_2224.py create mode 100644 atlas/migrations/0031_alter_casecollection_collection_type.py diff --git a/atlas/migrations/0030_auto_20220331_2224.py b/atlas/migrations/0030_auto_20220331_2224.py new file mode 100644 index 00000000..c4b64d4b --- /dev/null +++ b/atlas/migrations/0030_auto_20220331_2224.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2.10 on 2022-03-31 21:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0029_casecollection_show_report'), + ] + + operations = [ + migrations.RemoveField( + model_name='casecollection', + name='open_access', + ), + migrations.AddField( + model_name='casecollection', + name='collection_type', + field=models.IntegerField(choices=[(1, 'Review'), (2, 'Basic Text Input')], default=1), + ), + migrations.AddField( + model_name='casecollection', + name='published', + field=models.BooleanField(default=True, help_text='If a collection should published'), + ), + ] diff --git a/atlas/migrations/0031_alter_casecollection_collection_type.py b/atlas/migrations/0031_alter_casecollection_collection_type.py new file mode 100644 index 00000000..7c152764 --- /dev/null +++ b/atlas/migrations/0031_alter_casecollection_collection_type.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.10 on 2022-03-31 21:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0030_auto_20220331_2224'), + ] + + operations = [ + migrations.AlterField( + model_name='casecollection', + name='collection_type', + field=models.CharField(choices=[('RE', 'Review'), ('BTI', 'Basic Text Input')], default='RE', max_length=3), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 6d187e7a..5abeff1d 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -564,8 +564,8 @@ class CaseCollection(models.Model): cases = models.ManyToManyField(Case, through="CaseDetail") - open_access = models.BooleanField( - help_text="If a collection should be freely available to browse", default=True + published = models.BooleanField( + help_text="If a collection should published", default=True ) show_title = models.BooleanField(default=False, help_text="Show the title of the cases") @@ -580,6 +580,12 @@ class CaseCollection(models.Model): #related_name="atlas_authored_cases", ) + class COLLECTION_TYPE_CHOICES(models.TextChoices): + REVIEW = "RE", _("Review"), + BASIC_TEXT_INPUT = "BTI", _("Basic Text Input"), + + collection_type = models.CharField(max_length=3, choices=COLLECTION_TYPE_CHOICES.choices, default=COLLECTION_TYPE_CHOICES.REVIEW) + def get_absolute_url(self): return reverse("atlas:collection_detail_view", kwargs={"pk": self.pk})