activity.models.period
Classes
Built-in immutable sequence. |
|
Mixin providing created/modified timestamps for all records. |
Module Contents
- class activity.models.period.PeriodMixin[source]
-
- as_local_datetime(day: datetime.date | datetime.datetime, end_of_day: bool = False) datetime.datetime [source]
Returns the moment of midnight in terms of the timezone it UTC
- class activity.models.period.PeriodMeta[source]
Bases:
PeriodMetaBase
,PeriodMixin
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.
If the argument is a tuple, the return value is the same object.
- class activity.models.period.Period[source]
Bases:
onegov.core.orm.Base
,PeriodMixin
,onegov.core.orm.mixins.TimestampMixin
Mixin providing created/modified timestamps for all records.
The columns are deferred loaded as this is primarily for logging and future forensics.
- publication_requests: relationship[list[PublicationRequest]][source]
- activate() None [source]
Activates the current period, causing all occasions and activites to update their status and book-keeping.
It also makes sure no other period is active.
- deactivate() None [source]
Deactivates the current period, causing all occasions and activites to update their status and book-keeping.
- archive() None [source]
Moves all accepted activities with an occasion in this period into the archived state, unless there’s already another occasion in a period newer than the current period.