univention.admindiary package#
- class univention.admindiary.DiaryEntry(username: str, message: str, args: dict[str, str], tags: list[str], context_id: str, event_name: str)[source]#
Bases:
object
Submodules#
univention.admindiary.backend module#
- univention.admindiary.backend.windowed_query(q, column, windowsize, single_entity=True)[source]#
Break a Query into chunks on a given unique column (usually primary key), then fetch chunks using LIMIT only, adding a WHERE clause that will ensure we only fetch rows greater than the last one we fetched. This will work for basically any database backend. The potential downside is that the database needs to sort the full set of remaining rows for each chunk, which may be inefficient, even if the sort column is indexed. However, the approach is very simple and can likely work for most ordinary use cases for a primary key column on a database that does not support window functions.
- univention.admindiary.backend.get_session(auto_commit: bool = True) Iterator[sqlalchemy.Session][source]#
- class univention.admindiary.backend.Meta(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- id#
- schema#
- class univention.admindiary.backend.Event(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- id#
- name#
- class univention.admindiary.backend.EventMessage(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- event_id#
- locale#
- message#
- locked#
- class univention.admindiary.backend.Entry(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- id#
- username#
- hostname#
- message#
- timestamp#
- context_id#
- event_id#
- main_id#
- event#
- args#
- tags#
- comments#
- class univention.admindiary.backend.Tag(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- id#
- name#
- entries#
- class univention.admindiary.backend.Arg(**kwargs)[source]#
Bases:
BaseA simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- id#
- entry_id#
- key#
- value#
- entry#
univention.admindiary.client module#
- univention.admindiary.client.add_comment(message: str, context_id: str, username: str | None = None) int | None[source]#
- univention.admindiary.client.write_event(event: DiaryEvent, args: dict[str, str] | None = None, username: str | None = None, context_id: str | None = None) int | None[source]#
- univention.admindiary.client.write(message: str, args: dict[str, str] | None = None, username: str | None = None, tags: list[str] | None = None, context_id: str | None = None, event_name: str | None = None) int | None[source]#
- univention.admindiary.client.write_entry(entry: DiaryEntry) int | None[source]#