gazette.models.category

Classes

Category

Defines a category for official notices.

Module Contents

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).

__tablename__ = 'gazette_categories'[source]
active: Column[bool | None][source]
parent: sqlalchemy.orm.relationship[Category | None][source]
notices() Query[GazetteNotice][source]

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

property in_use: bool[source]

True, if the category is used by any notice.

title_observer(title: str) None[source]

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