From 7ec972b73c80a0e257f82893e552a26b3e008515 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 25 Oct 2021 11:16:54 +0100 Subject: [PATCH] . --- anatomy/forms.py | 13 ++----------- .../0052_remove_anatomyquestion_structure.py | 17 +++++++++++++++++ anatomy/models.py | 11 +---------- 3 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 anatomy/migrations/0052_remove_anatomyquestion_structure.py diff --git a/anatomy/forms.py b/anatomy/forms.py index b1c13b7f..65740bcc 100644 --- a/anatomy/forms.py +++ b/anatomy/forms.py @@ -86,15 +86,6 @@ class AnatomyQuestionForm(ModelForm): queryset=Modality.objects.all(), ) - #self.fields["Structure"] = ModelChoiceField( - # required=False, - # queryset=Structure.objects.all(), - #) - #self.fields["structure"] = ModelChoiceField( - # queryset=Structure.objects.all(), - # widget=autocomplete.ModelSelect2(url='anatomy:structure-autocomplete') - #) - self.fields["examination"] = ModelChoiceField( required=False, queryset=Examination.objects.all(), @@ -148,7 +139,7 @@ class AnatomyQuestionForm(ModelForm): "image", "region", "modality", - "structure", + #"structure", "examination", "body_part", "description", @@ -156,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/0052_remove_anatomyquestion_structure.py b/anatomy/migrations/0052_remove_anatomyquestion_structure.py new file mode 100644 index 00000000..3a6c1a57 --- /dev/null +++ b/anatomy/migrations/0052_remove_anatomyquestion_structure.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.8 on 2021-10-25 10:15 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('anatomy', '0051_alter_anatomyquestion_structure'), + ] + + operations = [ + migrations.RemoveField( + model_name='anatomyquestion', + name='structure', + ), + ] diff --git a/anatomy/models.py b/anatomy/models.py index 7e5da5b3..9ebb9b4e 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -42,13 +42,7 @@ class BodyPart(models.Model): return self.bodypart -#class Structure(models.Model): -# structure = models.CharField(max_length=200, primary_key=True) -# -# def __str__(self): -# return self.structure - -class Structure2(models.Model): +class Structure(models.Model): structure = models.CharField(max_length=200, unique=True) def __str__(self): @@ -118,9 +112,6 @@ class AnatomyQuestion(models.Model): #structure = models.ForeignKey( # Structure, on_delete=models.SET_NULL, null=True, blank=True #) - structure = models.CharField( - max_length=255, null=True - ) created_date = models.DateTimeField(default=timezone.now) open_access = models.BooleanField(