diff --git a/atlas/forms.py b/atlas/forms.py index 5515368c..0b23cc89 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -228,6 +228,7 @@ class CaseForm(ModelForm): "subspecialty", "description", "history", + "presentation", "condition", # "differential", # "sign", @@ -245,6 +246,9 @@ class CaseForm(ModelForm): "condition": autocomplete.ModelSelect2Multiple( url="atlas:condition-autocomplete" ), + "presentation": autocomplete.ModelSelect2Multiple( + url="atlas:presentation-autocomplete" + ), } def save(self, commit=True): diff --git a/atlas/models.py b/atlas/models.py index e532bc8e..7f2623d2 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -136,6 +136,8 @@ class Presentation(SynMixin, models.Model): subspecialty = models.ManyToManyField("subspecialty", blank=True) def __str__(self) -> str: + if self.subspecialty: + return f"{self.name} ({', '.join([i for i in self.subspecialty.all()]})" return self.name def get_absolute_url(self): @@ -211,6 +213,8 @@ class Case(models.Model): condition = models.ManyToManyField(Condition, blank=True) + presentation = models.ManyToManyField(Presentation, blank=True) + pathalogical_process = models.ManyToManyField(PathalogicalProcess, blank=True) differential = models.ManyToManyField(