timApp.readmark package#

Submodules#

timApp.readmark.readings module#

timApp.readmark.readings.copy_readings(src_par: timApp.document.docparagraph.DocParagraph, dest_par: timApp.document.docparagraph.DocParagraph)[source]#
timApp.readmark.readings.get_clicked_readings_query(doc: timApp.document.document.Document) sqlalchemy.orm.query.Query[source]#
timApp.readmark.readings.get_common_readings(usergroup_ids: list[int], doc: timApp.document.document.Document, filter_condition=None)[source]#
timApp.readmark.readings.get_read_expiry_condition(delta: datetime.timedelta)[source]#
timApp.readmark.readings.get_read_usergroups_count(doc: timApp.document.document.Document)[source]#
timApp.readmark.readings.get_readings(usergroup_id: int, doc: timApp.document.document.Document, filter_condition=None) list[timApp.readmark.readparagraph.ReadParagraph][source]#
timApp.readmark.readings.get_readings_filtered_query(usergroup_id: int, doc: timApp.document.document.Document, filter_condition=None) sqlalchemy.orm.query.Query[source]#
timApp.readmark.readings.get_readings_query(usergroup_id: int, doc: timApp.document.document.Document) sqlalchemy.orm.query.Query[source]#

Gets the reading info for a document for a user.

Parameters
  • doc – The document for which to get the readings.

  • usergroup_id – The id of the user group whose readings will be fetched.

timApp.readmark.readings.has_anything_read(usergroup_ids: list[int], doc: timApp.document.document.Document) bool[source]#
timApp.readmark.readings.mark_all_read(usergroup_id: int, doc: timApp.document.document.Document)[source]#
timApp.readmark.readings.mark_read(usergroup_id: int, doc: timApp.document.document.Document, par: timApp.document.docparagraph.DocParagraph, read_type=ReadParagraphType.click_red)[source]#
timApp.readmark.readings.remove_all_read_marks(doc: timApp.document.document.Document)[source]#

timApp.readmark.readmarkcollection module#

class timApp.readmark.readmarkcollection.ReadMarkCollection(marks: list[timApp.readmark.readparagraph.ReadParagraph] = <factory>)[source]#

Bases: object

add(r: timApp.readmark.readparagraph.ReadParagraph, modified=False)[source]#
property class_str#
marks: list[timApp.readmark.readparagraph.ReadParagraph]#

timApp.readmark.readparagraph module#

class timApp.readmark.readparagraph.ReadParagraph(**kwargs)[source]#

Bases: sqlalchemy.ext.declarative.api.Model

Denotes that a User(Group) has read a specific paragraph in some way.

doc_id#

Document id.

id#

Readmark id.

par_hash#

Paragraph hash at the time the readmark was registered.

par_id#

Paragraph id.

timestamp#

The time the readmark was registered.

type#

Readmark type.

usergroup#
usergroup_id#

UserGroup id.

timApp.readmark.readparagraphtype module#

class timApp.readmark.readparagraphtype.ReadParagraphType(value)[source]#

Bases: enum.Enum

An enumeration.

property class_str#
click_par = 3#
click_red = 4#
hover_par = 2#
on_screen = 1#
to_json()[source]#

timApp.readmark.routes module#

class timApp.readmark.routes.ReadModel(pars: list[tuple[int, str]] | None = None)[source]#

Bases: object

pars: list[tuple[int, str]] | None = None#
timApp.readmark.routes.get_read_groups_count(doc_id: int)[source]#
timApp.readmark.routes.get_read_paragraph(doc_id, block_id)[source]#
timApp.readmark.routes.get_read_paragraphs(doc_id)[source]#
timApp.readmark.routes.get_readings_response(cond, doc_id)[source]#
timApp.readmark.routes.get_statistics(doc_path)[source]#
timApp.readmark.routes.mark_all_unread(doc_id: int)[source]#
timApp.readmark.routes.mark_document_read(doc_id)[source]#
timApp.readmark.routes.set_read_paragraph(doc_id, par_id, read_type=None, unread=False)[source]#
timApp.readmark.routes.unread_paragraph(doc_id, par_id)[source]#

Module contents#