activity.models.period
Classes
| Built-in immutable sequence. | |
| Mixin providing created/modified timestamps for all records. | 
Module Contents
- class activity.models.period.BookingPeriodMixin[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.BookingPeriodMeta[source]
- Bases: - _BookinPeriodMeta,- BookingPeriodMixin- 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. - materialize(session: sqlalchemy.orm.Session) BookingPeriod[source]
 
- class activity.models.period.BookingPeriod[source]
- Bases: - onegov.core.orm.Base,- BookingPeriodMixin,- 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: sqlalchemy.orm.relationship[list[onegov.activity.models.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. 
 - confirm_and_start_booking_phase() None[source]
- Confirms the period and sets the booking phase to now. - This is mainly an internal convenience function to activate the previous behaviour before a specific booking phase date was introduced. 
 - materialize(session: sqlalchemy.orm.Session) BookingPeriod[source]