From 447e6acab813693b6ef4dd97c2fccdcf6db6778d Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 28 Nov 2021 16:23:22 +0000 Subject: [PATCH] . --- atlas/admin.py | 6 +-- atlas/forms.py | 8 ++-- atlas/migrations/0007_auto_20211128_1622.py | 49 +++++++++++++++++++++ atlas/models.py | 7 ++- 4 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 atlas/migrations/0007_auto_20211128_1622.py diff --git a/atlas/admin.py b/atlas/admin.py index 3b5eccd4..e4fa86c7 100755 --- a/atlas/admin.py +++ b/atlas/admin.py @@ -30,7 +30,7 @@ class AtlasAdminForm(ModelForm): "description", "history", "sign", - "findings", + #"findings", "author", "series", ] @@ -39,8 +39,8 @@ class AtlasAdminForm(ModelForm): # "normal": RadioSelect( # choices=[(True, 'Yes'), # (False, 'No')]) - "findings": TinyMCE(attrs={"cols": 80, "rows": 30}), - "mark_scheme": TinyMCE(attrs={"cols": 80, "rows": 30}), + #"findings": TinyMCE(attrs={"cols": 80, "rows": 30}), + #"mark_scheme": TinyMCE(attrs={"cols": 80, "rows": 30}), } diff --git a/atlas/forms.py b/atlas/forms.py index 07ee4739..1f87853f 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -144,9 +144,9 @@ class CaseForm(ModelForm): "subspecialty", "description", "history", - "findings", + #"findings", "condition", - "sign", + #"sign", "open_access", ] # fields = ['question', 'findings', 'subspecialty', 'references'] @@ -154,8 +154,8 @@ class CaseForm(ModelForm): # "normal": RadioSelect( # choices=[(True, 'Yes'), # (False, 'No')]) - "findings": TinyMCE(attrs={"cols": 80, "rows": 20}), - "mark_scheme": TinyMCE(attrs={"cols": 80, "rows": 30}), + #"findings": TinyMCE(attrs={"cols": 80, "rows": 20}), + #"mark_scheme": TinyMCE(attrs={"cols": 80, "rows": 30}), "description": Textarea(attrs={"cols": 80, "rows": 5}), "history": Textarea(attrs={"cols": 80, "rows": 5}), } diff --git a/atlas/migrations/0007_auto_20211128_1622.py b/atlas/migrations/0007_auto_20211128_1622.py new file mode 100644 index 00000000..5305a9e1 --- /dev/null +++ b/atlas/migrations/0007_auto_20211128_1622.py @@ -0,0 +1,49 @@ +# Generated by Django 3.2.4 on 2021-11-28 16:22 + +import atlas.models +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0006_auto_20211128_1448'), + ] + + operations = [ + migrations.CreateModel( + name='Finding', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('primary_name', models.BooleanField(default='True')), + ('synonym', models.ManyToManyField(blank=True, related_name='_atlas_finding_synonym_+', to='atlas.Finding')), + ], + bases=(atlas.models.SynMixin, models.Model), + ), + migrations.RemoveField( + model_name='case', + name='findings', + ), + migrations.AlterField( + model_name='case', + name='description', + field=models.TextField(blank=True, help_text='Description of the case'), + ), + migrations.AlterField( + model_name='series', + name='description', + field=models.TextField(blank=True, help_text='Description of stack'), + ), + migrations.CreateModel( + name='SeriesFindings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.TextField(blank=True, help_text='Findings on the series / stack', null=True)), + ('annotation_json', models.TextField(blank=True, null=True)), + ('findings', models.ManyToManyField(blank=True, to='atlas.Finding')), + ('series', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='findings', to='atlas.series')), + ], + ), + ] diff --git a/atlas/models.py b/atlas/models.py index 6ef559d5..aef6865d 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -134,7 +134,7 @@ class Case(models.Model): history = models.TextField(null=True, blank=True) - findings = models.TextField(null=True, blank=True) + #findings = models.TextField(null=True, blank=True) #subspecialty = models.CharField(max_length=2, choices=SubspecialtyChoices.choices) subspecialty = models.ManyToManyField(Subspecialty, blank=True) @@ -210,6 +210,9 @@ class SeriesFindings(models.Model): series = models.ForeignKey( "Series", related_name="findings", on_delete=models.SET_NULL, null=True ) + description = models.TextField(null=True, blank=True, help_text="Findings on the series / stack") + findings = models.ManyToManyField(Finding, blank=True) + annotation_json = models.TextField(null=True, blank=True) @reversion.register class Series(models.Model): @@ -253,7 +256,7 @@ class Series(models.Model): related_name="series", ) - findings = models.TextField(null=True, blank=True, help_text="Findings on the series / stack") + #findings = models.TextField(null=True, blank=True, help_text="Findings on the series / stack") open_access = models.BooleanField( help_text="If a question should be freely available to browse", default=True