Refactor CaseDetail references to Casedetail across templates and views

- Updated all instances of 'case_detail' to 'casedetail' in templates to maintain consistency.
- Adjusted view functions to use 'casedetail' instead of 'case_detail' for better clarity.
- Renamed the field 'case_detail' to 'casedetail' in the CasePrior model to align with the new naming convention.
- Ensured that all related logic and references in forms and data handling reflect this change.
This commit is contained in:
Ross
2025-11-17 10:34:27 +00:00
parent 7f4570417e
commit 12b7fa6629
19 changed files with 230 additions and 208 deletions
+3 -3
View File
@@ -1545,7 +1545,7 @@ class CaseDetail(models.Model):
return mark_safe(html)
class CasePrior(models.Model):
case_detail = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
casedetail = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
prior_case = models.ForeignKey(Case, on_delete=models.CASCADE, related_name="prior_case")
relation_text = models.CharField(max_length=255, blank=True, help_text="Text to describe the relationship between the cases")
@@ -1564,10 +1564,10 @@ class CasePrior(models.Model):
)
class Meta:
unique_together = ("case_detail", "prior_case")
unique_together = ("casedetail", "prior_case")
def __str__(self) -> str:
return f"{self.case_detail.case} -> {self.prior_case}"
return f"{self.casedetail.case} -> {self.prior_case}"
class BaseReportAnswer(models.Model):
question = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)