Module

core.page.relationships

Page Relationships Mixin - Relationship checking and comparisons.

Classes

PageRelationshipsMixin
Mixin providing relationship checking for pages. This mixin handles: - Page equality checking - Se…
4

Mixin providing relationship checking for pages.

This mixin handles:

  • Page equality checking
  • Section membership
  • Ancestor/descendant relationships

Attributes

Name Type Description
source_path Path
_section Section | None
is_section bool

Methods 4

eq
Check if two pages are equal.
1 bool
def eq(self, other: Page) -> bool

Check if two pages are equal.

Parameters 1
other Page

Page to compare with

Returns

bool

True if pages are the same

in_section
Check if this page is in the given section.
1 bool
def in_section(self, section: Any) -> bool

Check if this page is in the given section.

Parameters 1
section Any

Section to check

Returns

bool

True if page is in the section

is_ancestor
Check if this page is an ancestor of another page.
1 bool
def is_ancestor(self, other: Page) -> bool

Check if this page is an ancestor of another page.

Parameters 1
other Page

Page to check

Returns

bool

True if this page is an ancestor

is_descendant
Check if this page is a descendant of another page.
1 bool
def is_descendant(self, other: Page) -> bool

Check if this page is a descendant of another page.

Parameters 1
other Page

Page to check

Returns

bool

True if this page is a descendant