landsgemeinde.utils
Functions
|
Updates the ticker by a set of updated assemblies, agenda items or |
|
Ensure that all the states are meaningful when changing the state of |
|
Convert a timestamp to seconds. |
|
Convert seconds to a timestamp. |
Module Contents
- landsgemeinde.utils.update_ticker(request: onegov.landsgemeinde.request.LandsgemeindeRequest, updated: Collection[Assembly | AgendaItem | Votum]) None [source]
Updates the ticker by a set of updated assemblies, agenda items or vota.
Sends either a ‘refresh’ event to reload the whole ticker (in case the assembly has been changed or an agenda item has been added/deleted) or and ‘update’ event with the changed content of the agenda item.
Provide an assembly to ensure, that the whole ticker is reloaded.
Also sets the modified timestamp on the assembly used for the polling fallback.
- landsgemeinde.utils.ensure_states(item: onegov.landsgemeinde.models.Assembly | onegov.landsgemeinde.models.AgendaItem | onegov.landsgemeinde.models.Votum) set[onegov.landsgemeinde.models.Assembly | onegov.landsgemeinde.models.AgendaItem | onegov.landsgemeinde.models.Votum] [source]
Ensure that all the states are meaningful when changing the state of an assembly, agenda item or votum.
Also sets and clears the start time of agenda items.
Returns a set with updated assemblies, agenda items and vota.