newsletter.collection

Classes

NewsletterCollection

RecipientCollection

Module Contents

class newsletter.collection.NewsletterCollection(session: sqlalchemy.orm.Session)[source]
query() Query[Newsletter][source]
by_name(name: str) onegov.newsletter.Newsletter | None[source]
add(title: str, html: str, lead: str | None = None, meta: dict[str, Any] | None = None, content: dict[str, Any] | None = None, scheduled: datetime | None = None) onegov.newsletter.Newsletter[source]
delete(newsletter: onegov.newsletter.Newsletter) None[source]
class newsletter.collection.RecipientCollection(session: sqlalchemy.orm.Session)[source]
query() Query[Recipient][source]
by_id(id: str | UUID) onegov.newsletter.Recipient | None[source]
by_address(address: str, group: str | None = None) onegov.newsletter.Recipient | None[source]
ordered_by_status_address() Query[Recipient][source]

Orders the recipients by status and address.

add(address: str, group: str | None = None, confirmed: bool = False) onegov.newsletter.Recipient[source]
delete(recipient: onegov.newsletter.Recipient) None[source]
count() int[source]

Returns the number of recipients.