timelink.app.models package

Submodules

timelink.app.models.project module

Timelink projects

A project is a collection of Kleio sources and a database to store the data.

Access of the user to Kleio sources is done through a Kleio server. In the Kleio server each user has an acess token that determines the access level to the sources directory. So for each project the user needs to have a valid access token to the Kleio server and its url.

Each project is associated with a database. Timelink is tested with PostgreSQL and SQLite databases.

When using SQLite, the database is a file in the file system. When using PostgreSQL, each project is associated with a database (see https://www.postgresql.org/docs/8.0/managing-databases.html) and each project is associated with a user and a password to access the database.

Users have different access levels to the projects. The access levels are:

  1. admin: the user has full access to the project, including the ability to associate new users to the project.

  2. manager: the user has access to the project, can import data and identify entities in the data, can add commentaries, but cannot associate new users to the project.

  3. collaborator: the user has access to the project, cannot import data, but can identify entities in the data and add commentaries.

  4. viewer: the user has access to the project, but cannot import data, identify people or add commentaries.

class timelink.app.models.project.AccessLevel(value)[source]

An enumeration.

class timelink.app.models.project.Project(**kwargs)[source]

A 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.

class timelink.app.models.project.ProjectAccess(**kwargs)[source]

A 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.

timelink.app.models.user module

Timelink User model

timelink users are registered users of the application.

Each user can be associated with one or more “projects”.

A project is a collection of Kleio sources and a database to store the data.

Access of the user to Kleio sources is done through a Kleio server. In the Kleio server each user has an acess token that determines the access level to the sources directory. So for each project the user needs to have a valid access token to the Kleio server and its url.

Each project is associated with a database. Timelink is tested with PostgreSQL and SQLite databases.

When using SQLite, the database is a file in the file system. When using PostgreSQL, each project is associated with a database (see https://www.postgresql.org/docs/8.0/managing-databases.html) and each project is associated with a user and a password to access the database.

users have different access levels to the projects. The access levels are:

  1. admin: the user has full access to the project, including the ability to associate

    new users to the project.

  2. manager: the user has access to the project, can import data and identify

    entities in the data, can add commentaries, but cannot associate new users to the project.

  3. colaborator: the user has access to the project, cannot import data, but can

    identify entities in the data and add commentaries.

  4. viewer: the user has access to the project, but cannot import data, identify

    people or add commentaries.

class timelink.app.models.user.Base(**kwargs: Any)[source]

A 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.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class timelink.app.models.user.User(**kwargs)[source]
id

Primary key, autoincrement.

Type:

int

name

Required.

Type:

str

nickname

Optional.

Type:

str

email

Required, unique.

Type:

str

hashed_password

Optional.

Type:

str

disabled

Optional, default is False.

Type:

bool

created

Required, default is now.

Type:

datetime

updated

Optional, default is now, updated at now.

Type:

datetime

A 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.

as_schema()[source]

Return the pydantic model for this object.

class timelink.app.models.user.UserProperty(**kwargs)[source]

A 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.

as_schema()[source]

Return the pydantic model for this object.

timelink.app.models.user_database module