diff --git a/anatomy/forms.py b/anatomy/forms.py index 65740bcc..241801b2 100644 --- a/anatomy/forms.py +++ b/anatomy/forms.py @@ -139,7 +139,7 @@ class AnatomyQuestionForm(ModelForm): "image", "region", "modality", - #"structure", + "structure", "examination", "body_part", "description", @@ -147,7 +147,7 @@ class AnatomyQuestionForm(ModelForm): ] widgets = { - #"structure" : autocomplete.ModelSelect2(url='anatomy:structure-autocomplete') + "structure" : autocomplete.ModelSelect2(url='anatomy:structure-autocomplete') } diff --git a/anatomy/migrations/0053_anatomyquestion_structure.py b/anatomy/migrations/0053_anatomyquestion_structure.py new file mode 100644 index 00000000..03660966 --- /dev/null +++ b/anatomy/migrations/0053_anatomyquestion_structure.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.8 on 2021-10-25 10:17 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('anatomy', '0052_remove_anatomyquestion_structure'), + ] + + operations = [ + migrations.AddField( + model_name='anatomyquestion', + name='structure', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='anatomy.structure'), + ), + ] diff --git a/anatomy/models.py b/anatomy/models.py index 9ebb9b4e..a06e5126 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -109,9 +109,9 @@ class AnatomyQuestion(models.Model): body_part = models.ForeignKey( BodyPart, on_delete=models.SET_NULL, null=True, blank=True ) - #structure = models.ForeignKey( - # Structure, on_delete=models.SET_NULL, null=True, blank=True - #) + structure = models.ForeignKey( + Structure, on_delete=models.SET_NULL, null=True, blank=True + ) created_date = models.DateTimeField(default=timezone.now) open_access = models.BooleanField(