org.models.push_notification

Classes

PushNotification

Keeps track of all outbound push notifications to prevent duplicates.

PushNotificationCollection

Simple collection for sent notifications.

Module Contents

class org.models.push_notification.PushNotification[source]

Bases: onegov.core.orm.Base

Keeps track of all outbound push notifications to prevent duplicates.

__tablename__: ClassVar[str] = 'push_notification'[source]
id: sqlalchemy.Column[uuid.UUID][source]
news_id: sqlalchemy.Column[int][source]
news: sqlalchemy.orm.relationship[onegov.org.models.News][source]
topic_id: sqlalchemy.Column[str][source]
sent_at[source]
response_data: sqlalchemy.Column[dict[str, Any] | None][source]
classmethod was_notification_sent(session: sqlalchemy.orm.Session, news_id: int, topic_id: str) bool[source]
classmethod record_sent_notification(session: sqlalchemy.orm.Session, news_id: int, topic_id: str, response_data: dict[str, Any] | None) PushNotification[source]
__table_args__[source]
class org.models.push_notification.PushNotificationCollection(session: sqlalchemy.orm.Session, **kwargs: Any)[source]

Bases: onegov.core.collection.GenericCollection[PushNotification]

Simple collection for sent notifications.

property model_class: type[PushNotification][source]
query() sqlalchemy.orm.Query[PushNotification][source]