This commit is contained in:
Ross
2022-03-31 22:31:19 +01:00
parent a1010b0318
commit 15971a867c
3 changed files with 53 additions and 2 deletions
@@ -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'),
),
]
@@ -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),
),
]
+8 -2
View File
@@ -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})