page.collection

Classes

PageCollection

Manages a hierarchy of pages.

Module Contents

class page.collection.PageCollection(session: sqlalchemy.orm.session.Session)[source]

Bases: onegov.core.orm.abstract.AdjacencyListCollection[onegov.page.model.Page]

Manages a hierarchy of pages.

Use it like this:

from onegov.page import PageCollection pages = PageCollection(session)

__listclass__[source]

The list class this collection handles. Must inherit from AdjacencyList.

copy(page: onegov.page.model.Page, parent: onegov.page.model.Page | None) onegov.page.model.Page[source]

Takes the given page and copies it to a given parent.

The parent may be the same as the given page or another. If there’s a conflict with existing children, the name is adjusted using get_unique_child_name().