timApp.notification package#

Submodules#

timApp.notification.notification module#

class timApp.notification.notification.Notification(**kwargs)[source]#

Bases: sqlalchemy.ext.declarative.api.Model

Notification settings for a User for a block.

block: timApp.item.block.Block#
block_id#

Item id.

notification_type#

Notification type.

to_json() dict[source]#
user#
user_id#

User id.

class timApp.notification.notification.NotificationType(value)[source]#

Bases: enum.Enum

An enumeration.

AnswerAdded = 8#
CommentAdded = 5#
CommentDeleted = 7#
CommentModified = 6#
DocModified = 1#
ParAdded = 2#
ParDeleted = 4#
ParModified = 3#
property is_document_modification: bool#

timApp.notification.notify module#

class timApp.notification.notify.NotificationSubject(subject_template: str, num_count_modifier: Callable[[int], str])[source]#

Bases: object

message(user: str, num_count: int, resource_title: str) str[source]#
num_count_modifier: Callable[[int], str]#
subject_template: str#
timApp.notification.notify.force_process()[source]#
timApp.notification.notify.get_answer_count_str(num_mods)[source]#
timApp.notification.notify.get_comment_count_str(num_mods)[source]#
timApp.notification.notify.get_current_user_notifications(limit: Optional[int] = None)[source]#
timApp.notification.notify.get_edit_count_str(num_edits)[source]#
timApp.notification.notify.get_message_for(ps: list[timApp.notification.pending_notification.PendingNotification], d: timApp.document.docinfo.DocInfo, show_text: bool, show_names: bool)[source]#
timApp.notification.notify.get_name_string(users: list[timApp.user.user.User], show_names: bool)[source]#
timApp.notification.notify.get_notify_settings(doc_id)[source]#
timApp.notification.notify.get_par_count_str(num_mods)[source]#
timApp.notification.notify.get_subject_for(ps: list[timApp.notification.pending_notification.PendingNotification], d: timApp.document.docinfo.DocInfo, show_names: bool) str[source]#
timApp.notification.notify.get_type_of_notify(ps) timApp.notification.notification.NotificationType | str[source]#
timApp.notification.notify.get_user_count_str(num_users)[source]#
timApp.notification.notify.get_user_notify_settings()[source]#
timApp.notification.notify.notify_doc_watchers(doc: timApp.document.docinfo.DocInfo, content_msg: str, notify_type: timApp.notification.notification.NotificationType, par: Optional[timApp.document.docparagraph.DocParagraph] = None, old_version: Optional[tuple[int, int]] = None, curr_user: Optional[timApp.user.user.User] = None, **kwargs)[source]#
timApp.notification.notify.process_pending_notifications()[source]#
timApp.notification.notify.set_notify_settings(doc_id: int, email_comment_modify: bool, email_comment_add: bool, email_doc_modify: bool, email_answer_add: bool)[source]#

timApp.notification.pending_notification module#

class timApp.notification.pending_notification.AnswerNotification(**kwargs)[source]#

Bases: timApp.notification.pending_notification.PendingNotification

A notification that an answer has been added, changed or deleted.

answer_number#
block#
created#
discriminant#
doc_id#
property grouping_key: tuple[int, str]#
id#
kind#
par_id#
processed#
text#
user: timApp.user.user.User#
user_id#
class timApp.notification.pending_notification.CommentNotification(**kwargs)[source]#

Bases: timApp.notification.pending_notification.PendingNotification

A notification that a comment has been added, changed or deleted.

block#
created#
discriminant#
doc_id#
property grouping_key: tuple[int, str]#
id#
kind#
par_id#
processed#
text#
user: timApp.user.user.User#
user_id#
class timApp.notification.pending_notification.DocumentNotification(**kwargs)[source]#

Bases: timApp.notification.pending_notification.PendingNotification

A notification that a document has changed.

block#
created#
discriminant#
doc_id#
property grouping_key: tuple[int, str]#
id#
kind#
par_id#
processed#
text#
user: timApp.user.user.User#
user_id#
property version_after: tuple[int, int]#
property version_before: tuple[int, int]#
version_change: str#
class timApp.notification.pending_notification.PendingNotification(**kwargs)[source]#

Bases: sqlalchemy.ext.declarative.api.Model

block#
created#
discriminant#
doc_id#
property grouping_key: tuple[int, str]#
id#
kind#
property notify_type: timApp.notification.notification.NotificationType#
par_id#
processed#
text#
user: timApp.user.user.User#
user_id#
timApp.notification.pending_notification.get_pending_notifications() list[timApp.notification.pending_notification.PendingNotification][source]#

timApp.notification.send_email module#

timApp.notification.send_email.multi_send_email(rcpt: str, subject: str, msg: str, mail_from: str = 'tim@jyu.fi', reply_to: str = 'no-reply@tim.jyu.fi', bcc: str = '', reply_all: bool = False) None[source]#
timApp.notification.send_email.multi_send_email_impl(flask_app: flask.app.Flask, rcpt: str, subject: str, msg: str, mail_from: str = 'tim@jyu.fi', reply_to: str = 'no-reply@tim.jyu.fi', bcc: str = '', reply_all: bool = False) None[source]#
timApp.notification.send_email.send_email(rcpt: str, subject: str, msg: str, mail_from: str = 'tim@jyu.fi', reply_to: str = 'no-reply@tim.jyu.fi') threading.Thread | None[source]#
timApp.notification.send_email.send_email_impl(flask_app: flask.app.Flask, rcpt: str, subject: str, msg: str, mail_from: str = 'tim@jyu.fi', reply_to: str = 'no-reply@tim.jyu.fi') None[source]#

Module contents#