Defines an official notice.

Module Contents

class notice.models.OfficialNotice[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin

Defines an official notice.

The notice follows a typcical state transition: drafted by an editor -> submitted by and editor to a publisher -> accepted by a publisher -> published by the publisher. It may be alternatively rejected by a publisher when submitted.

The notice typically has a title and a text, belongs to a user and a user group, appears in one ore more issues and belongs to one or more categories and organizations.

You can set the date of the first issue besides setting the issues (to allow filtering by date for example).

You can set the category and organization directly instead of using the HSTOREs (or use both).

__tablename__ = 'official_notices'[source]
type: Column[str][source]
id: Column[uuid.UUID][source]
name: Column[str | None][source]
state: Column[NoticeState][source]
title: Column[str][source]
text: Column[str | None][source]
author_name: Column[str | None][source]
author_place: Column[str | None][source]
author_date: Column[datetime | None][source]
note: Column[str | None][source]
_issues: Column[dict[str, str | None]][source]
property issues: dict[str, str | None][source]
first_issue: Column[datetime | None][source]
expiry_date: Column[datetime | None][source]
property expired: bool[source]

Returns True, if the notice is expired.

_categories: Column[dict[str, str | None]][source]
property categories: dict[str, str | None][source]
category: Column[str | None][source]
organization: Column[str | None][source]
_organizations: Column[dict[str, str | None] | None][source]
property organizations: dict[str, str | None][source]
user_id: Column[uuid.UUID | None][source]
user: relationship[User | None][source]
group_id: Column[uuid.UUID | None][source]
group: relationship[UserGroup | None][source]
source: Column[str | None][source]
submit() None[source]

Submit a drafted notice.

reject() None[source]

Reject a submitted notice.

accept() None[source]

Accept a submitted notice.

publish() None[source]

Publish an accepted notice.