newsletter.collection ===================== .. py:module:: newsletter.collection Classes ------- .. autoapisummary:: newsletter.collection.NewsletterCollection newsletter.collection.RecipientCollection Module Contents --------------- .. py:class:: NewsletterCollection(session: sqlalchemy.orm.Session) .. py:attribute:: session .. py:method:: query() -> sqlalchemy.orm.Query[onegov.newsletter.Newsletter] .. py:method:: by_name(name: str) -> onegov.newsletter.Newsletter | None .. py:method:: add(title: str, html: markupsafe.Markup, lead: str | None = None, meta: dict[str, Any] | None = None, content: dict[str, Any] | None = None, scheduled: datetime.datetime | None = None) -> onegov.newsletter.Newsletter .. py:method:: delete(newsletter: onegov.newsletter.Newsletter) -> None .. py:class:: RecipientCollection(session: sqlalchemy.orm.Session) .. py:attribute:: session .. py:method:: query() -> sqlalchemy.orm.Query[onegov.newsletter.Recipient] .. py:method:: by_id(id: str | uuid.UUID) -> onegov.newsletter.Recipient | None .. py:method:: by_address(address: str, group: str | None = None) -> onegov.newsletter.Recipient | None .. py:method:: ordered_by_status_address() -> sqlalchemy.orm.Query[onegov.newsletter.Recipient] Orders the recipients by status and address. .. py:method:: add(address: str, group: str | None = None, confirmed: bool = False, subscribed_categories: list[str] | None = None) -> onegov.newsletter.Recipient .. py:method:: delete(recipient: onegov.newsletter.Recipient) -> None .. py:method:: count() -> int Returns the number of recipients.