Key
This module contains a basic Key Model
- class loglan_core.key.BaseKey(word, language)[source]
Bases:
BaseModelBase Key’s DB Model
Describes a table structure for storing information about keywords of the word’s definitions. Some keywords could belong to many definitions and some definitions could have many keywords. That’s why the relationship between Key and Definition should be many-to-many. See t_connect_keys.
There is additional word_language UniqueConstraint here.
<details><summary>Show Examples</summary><p> ```python {‘language’: ‘en’, ‘word’: ‘aura’, ‘id’: 1234}
{‘language’: ‘en’, ‘word’: ‘emotionality’, ‘id’: 4321} ``` </p></details>
- 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
- definitions: Mapped[list[BaseDefinition]]
- 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
- language: Mapped[str_016]
Key’s language str : max_length=16, 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
nullif the row has never been updated.- Type:
datetime
- word: Mapped[str_064]
- Key’s vernacular word
str : max_length=64, nullable=False, unique=False
It is non-unique, as words can be the same in spelling in different languages