diff --git a/atlas/forms.py b/atlas/forms.py index c89068e1..b3b6b6bf 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -232,7 +232,7 @@ class CaseForm(ModelForm): "discussion", "condition", "pathological_process", - # "sign", + "report", "open_access", ] # fields = ['question', 'findings', 'subspecialty', 'references'] diff --git a/atlas/migrations/0023_case_previous_case.py b/atlas/migrations/0023_case_previous_case.py new file mode 100644 index 00000000..d7bd72f5 --- /dev/null +++ b/atlas/migrations/0023_case_previous_case.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.10 on 2021-12-23 17:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0022_auto_20211214_1745'), + ] + + operations = [ + migrations.AddField( + model_name='case', + name='previous_case', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='next_case', to='atlas.case'), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index b83584f9..bab560aa 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -269,6 +269,8 @@ class Case(models.Model): notes = GenericRelation(QuestionNote) + previous_case = models.OneToOneField("Case", on_delete=models.SET_NULL, null=True, related_name="next_case") + # question_file = models.FileField(upload_to=question_file_directory_path, blank=True, null=True) def get_absolute_url(self): diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 6a5d0da7..b363f531 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -22,6 +22,8 @@

Discussion: {{ case.discussion }}

+

Report: {{ case.report }}

+
Series: {% for series in case.series.all %} @@ -109,6 +111,7 @@ {% endfor %}

+

Previous case: {{ case.previous_case }}

{% include 'question_notes.html' %}