gazette.models.category

Module Contents

Classes

Category

Defines a category for official notices.

class gazette.models.category.Category(title: str, parent: Self | None = None, **kwargs: Any)[source]

Bases: onegov.core.orm.abstract.AdjacencyList, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin

Defines a category for official notices.

Although the categories are defined as an adjacency list, we currently use it only as a simple alphabetically ordered key-value list (name-title).

property in_use: bool[source]

True, if the category is used by any notice.

__tablename__ = 'gazette_categories'[source]
active: Column[bool | None][source]
notices() Query[GazetteNotice][source]

Returns a query to get all notices related to this category.

title_observer(title: str) None[source]

Changes the category title of the notices when updating the title of the category.