Setting

This module contains a basic Setting Model

class loglan_core.setting.BaseSetting(date, db_version, last_word_id, db_release)[source]

Bases: BaseModel

Base Setting’s DB Model

Describes a table structure for storing dictionary settings.

<details><summary>Show Examples</summary><p> `python {'id': 1, 'last_word_id': 10141, 'date': datetime.datetime(2020, 10, 25, 5, 10, 20), 'db_release': '4.5.9', 'db_version': 2} ` </p></details>

__str__()[source]

Returns:

created: Mapped[datetime]

A class attribute mapped to a column in the database table. It represents the timestamp when a row is created. The default value is the current timestamp, and it can’t be null.

Type:

datetime

date: Mapped[datetime]

Last modified date dateime.datetime : nullable=False, unique=True

db_release: Mapped[Annotated[str]]

Database release (for new application) str : max_length=16, nullable=False, unique=True

db_version: Mapped[int]

Database version (for old application) int : nullable=False, unique=False

id: Mapped[int]

A class attribute mapped to a column in the database table. It serves as the primary key for the table.

Type:

int

last_word_id: Mapped[int]

ID number of the last word in DB int : nullable=False, unique=False

updated: Mapped[datetime | None]

A class attribute mapped to a column in the database table. It represents the timestamp when a row is last updated. Whenever the row is updated, this timestamp is automatically set to the current time. It can be null if the row has never been updated.

Type:

datetime