From eb144a7b715810e86a364218695e276ba8b811a8 Mon Sep 17 00:00:00 2001 From: Artur Borecki Date: Thu, 12 Mar 2026 10:22:55 +0100 Subject: [PATCH] feat(home/models.py): add `CourseModulePage` model --- home/models.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/home/models.py b/home/models.py index 3c7bfc0..551c9aa 100644 --- a/home/models.py +++ b/home/models.py @@ -12,3 +12,22 @@ class CoursePage(Page): body = RichTextField(blank=True) content_panels = Page.content_panels + ["body"] + + +class CourseModulePage(Page): + body = RichTextField(blank=True) + + @property + def full_title(self): + if hasattr(self, "get_parent"): + parent = self.get_parent() + if parent and hasattr(parent, "specific"): + course = parent.specific + else: + course = None + + if course and hasattr(course, "title"): + return f"{course.title} – {self.title}" + return self.title + + content_panels = Page.content_panels + ["body"]