activity.models.activity

Attributes

ActivityState

ACTIVITY_STATES

Classes

Activity

Describes an activity that is made available to participants on

Module Contents

activity.models.activity.ActivityState: TypeAlias = Literal['preview', 'proposed', 'accepted', 'archived'][source]
activity.models.activity.ACTIVITY_STATES: tuple[ActivityState, Ellipsis] = ('preview', 'proposed', 'accepted', 'archived')[source]
class activity.models.activity.Activity[source]

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

Describes an activity that is made available to participants on certain occasions (i.e. dates).

The activity describes the what’s going on, the occasion describes when and with whom.

__tablename__ = 'activities'[source]
id: sqlalchemy.Column[uuid.UUID][source]
name: sqlalchemy.Column[str][source]
title: sqlalchemy.Column[str][source]
order: sqlalchemy.Column[str][source]
lead: onegov.core.orm.mixins.dict_property[str | None][source]
text[source]
thumbnail: onegov.core.orm.mixins.dict_property[str | None][source]
_tags: sqlalchemy.Column[dict[str, str] | None][source]
username: sqlalchemy.Column[str][source]
reporter: sqlalchemy.Column[str][source]
location: sqlalchemy.Column[str | None][source]
municipality: sqlalchemy.Column[str | None][source]
user: sqlalchemy.orm.relationship[onegov.user.User][source]
occasions: sqlalchemy.orm.relationship[list[onegov.activity.models.occasion.Occasion]][source]
type: sqlalchemy.Column[str][source]
state: sqlalchemy.Column[ActivityState][source]
publication_requests: sqlalchemy.orm.relationship[list[onegov.activity.models.PublicationRequest]][source]
__mapper_args__[source]
title_observer(title: str) None[source]
username_observer(username: str) None[source]
content_observer(content: dict[str, Any] | None) None[source]
location_observer(content: str | None) None[source]
property tags: set[str][source]
propose() Self[source]
accept() Self[source]
archive() Self[source]
create_publication_request(period: onegov.activity.models.period.Period, **kwargs: Any) onegov.activity.models.PublicationRequest[source]
property requests: onegov.activity.collections.publication_request.PublicationRequestCollection[source]
property latest_request: onegov.activity.models.PublicationRequest | None[source]
request_by_period(period: onegov.activity.models.period.Period | onegov.activity.models.PeriodMeta | None) onegov.activity.models.PublicationRequest | None[source]
has_occasion_in_period(period: onegov.activity.models.period.Period | onegov.activity.models.PeriodMeta) bool[source]