feat(home/models.py): add CourseModulePage model
This commit is contained in:
@@ -12,3 +12,22 @@ class CoursePage(Page):
|
|||||||
body = RichTextField(blank=True)
|
body = RichTextField(blank=True)
|
||||||
|
|
||||||
content_panels = Page.content_panels + ["body"]
|
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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user