This commit is contained in:
Ross
2021-12-07 15:14:11 +00:00
parent c83292655e
commit 9d331308f6
4 changed files with 27 additions and 9 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ class CaseForm(ModelForm):
"history", "history",
"presentation", "presentation",
"condition", "condition",
"pathalogical_process", "pathological_process",
# "sign", # "sign",
"open_access", "open_access",
] ]
@@ -0,0 +1,18 @@
# Generated by Django 3.2.8 on 2021-12-07 15:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('atlas', '0019_case_presentation'),
]
operations = [
migrations.RenameField(
model_name='case',
old_name='pathalogical_process',
new_name='pathological_process',
),
]
+2 -2
View File
@@ -170,7 +170,7 @@ class PathalogicalProcess(models.Model):
return self.name return self.name
def get_absolute_url(self): def get_absolute_url(self):
return reverse("atlas:pathalogical_process_detail", kwargs={"pk": self.pk}) return reverse("atlas:pathological_process_detail", kwargs={"pk": self.pk})
def get_link(self): def get_link(self):
return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name) return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name)
@@ -230,7 +230,7 @@ class Case(models.Model):
presentation = models.ManyToManyField(Presentation, blank=True) presentation = models.ManyToManyField(Presentation, blank=True)
pathalogical_process = models.ManyToManyField(PathalogicalProcess, blank=True) pathological_process = models.ManyToManyField(PathalogicalProcess, blank=True)
differential = models.ManyToManyField( differential = models.ManyToManyField(
Condition, through=Differential, related_name="casedifferential" Condition, through=Differential, related_name="casedifferential"
@@ -5,20 +5,20 @@
<div class="floating-header"> <div class="floating-header">
{% comment %} <a href="{% url 'atlas:pathalogical_process_update' pk=pathalogical_process.pk %}" title="Edit the Condition">Edit</a> {% comment %} <a href="{% url 'atlas:pathological_process_update' pk=pathological_process.pk %}" title="Edit the Condition">Edit</a>
<a href="{% url 'atlas:pathalogical_process_delete' pk=pathalogical_process.pk %}" title="Delete the Condition">Delete</a> {% endcomment %} <a href="{% url 'atlas:pathological_process_delete' pk=pathological_process.pk %}" title="Delete the Condition">Delete</a> {% endcomment %}
{% if request.user.is_superuser %} {% if request.user.is_superuser %}
<a href="{% url 'admin:atlas_pathalogicalprocess_change' pathalogical_process.id %}" <a href="{% url 'admin:atlas_pathologicalprocess_change' pathological_process.id %}"
title="Edit the Condition using the admin interface">Admin Edit</a> title="Edit the Condition using the admin interface">Admin Edit</a>
{% endif %} {% endif %}
</div> </div>
<div> <div>
<h3>Name: {{pathalogical_process.name}}</h3> <h3>Name: {{pathological_process.name}}</h3>
</div> </div>
{% if pathalogical_process.case_set.all %} {% if pathological_process.case_set.all %}
<h4>Associated Cases</h4> <h4>Associated Cases</h4>
<ul> <ul>
{% for case in pathalogical_process.case_set.all %} {% for case in pathological_process.case_set.all %}
<li>{{case.get_link}}</li> <li>{{case.get_link}}</li>
{% endfor %} {% endfor %}
</ul> </ul>