WordSpell

This module contains a basic WordSpell Model

class loglan_core.word_spell.BaseWordSpell(id_old, name, type_id, event_start_id, event_end_id=None, tid_old=None, origin=None, origin_x=None, match=None, rank=None, year=None, notes=None)[source]

Bases: BaseWord

BaseWordSpell model

authors: Mapped[list[BaseAuthor]]

List of authors associated with the word.

This attribute establishes a many-to-many relationship with the BaseAuthor model, allowing for the retrieval of all authors who have contributed to the word. It is populated based on the association table t_connect_authors.

  • Type: list[BaseAuthor]

  • Nullable: True

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]]

List of definitions for the word.

This attribute establishes a one-to-many relationship with the BaseDefinition model, allowing for the retrieval of all definitions associated with the word. It is populated based on the relationship defined in the BaseDefinition model.

  • Type: list[BaseDefinition]

  • Nullable: True

derivatives: Mapped[list[BaseWord]]

List of words derived from this word.

This attribute establishes a many-to-many relationship with other BaseWord instances, allowing for the retrieval of all words that are derived from the current word. It is populated based on the association table t_connect_words.

  • Type: list[BaseWord]

  • Nullable: True

event_end: Mapped[BaseEvent | None]

Relationship to the BaseEvent model for the end event.

This attribute establishes a relationship with the BaseEvent model, allowing access to the event during which the word was deprecated. It is automatically populated based on the event_end_id.

  • Type: BaseEvent | None

  • Nullable: True

event_end_id: Mapped[int | None]

Foreign key referencing the end event.

This attribute links the word to the event during which it was deprecated or no longer in use. It is optional and can be set to None if there is no end event.

  • Type: int | None

  • Nullable: True

event_start: Mapped[BaseEvent]

Relationship to the BaseEvent model for the start event.

This attribute establishes a relationship with the BaseEvent model, allowing access to the event during which the word first appeared. It is automatically populated based on the event_start_id.

  • Type: BaseEvent

  • Nullable: False

event_start_id: Mapped[int]

Foreign key referencing the start event.

This attribute links the word to the event during which it was first recorded or used. It is required and cannot be null.

  • Type: int

  • Nullable: False

id: Mapped[int]

Word’s internal ID number.

This attribute serves as the primary key for the word in the database. It is an integer that uniquely identifies each word entry.

  • Type: int

  • Nullable: False

id_old: Mapped[int]

Legacy ID for compatibility with older databases.

This attribute is used to maintain compatibility with previous versions of the database. It is required and cannot be null.

  • Type: int

  • Nullable: False

match: Mapped[str_008 | None]

Matching criteria for the word.

This attribute defines any specific criteria used to match the word in queries or searches. It is optional and can be set to None if no matching criteria are defined.

  • Type: str_008 | None

  • Max Length: 8 characters

  • Nullable: True

name: Mapped[str_064]

The name of the word.

This attribute holds the actual word as a string. It is required and must be unique within the database.

  • Type: str_064

  • Max Length: 64 characters

  • Nullable: False

notes: Mapped[dict[str, str] | None]

Additional notes about the word.

This attribute allows for the storage of any extra information or comments regarding the word, encoded as a JSON dictionary. It is optional and can be set to None if no notes are provided.

  • Type: dict[str, str] | None

  • Nullable: True

origin: Mapped[str_128 | None]

The origin of the word.

This attribute provides information about the etymology or source of the word. It is optional and can be set to None if the origin is not known.

  • Type: str_128 | None

  • Max Length: 128 characters

  • Nullable: True

origin_x: Mapped[str_064 | None]

Additional origin information.

This attribute allows for any supplementary details regarding the word’s origin. It is optional and can be set to None if no additional information is available.

  • Type: str_064 | None

  • Max Length: 64 characters

  • Nullable: True

parents: Mapped[list[BaseWord]]

List of parent words of this word.

This attribute establishes a many-to-many relationship with other BaseWord instances, allowing for the retrieval of all parent words from which the current word is derived. It is populated based on the association table t_connect_words.

  • Type: list[BaseWord]

  • Nullable: True

rank: Mapped[str_008 | None]

Rank of the word.

This attribute indicates the importance or classification of the word within a specific context. It is optional and can be set to None if no rank is assigned.

  • Type: str_008 | None

  • Max Length: 8 characters

  • Nullable: True

tid_old: Mapped[int | None]

Legacy TID for compatibility.

This attribute serves as a legacy identifier for compatibility with older database systems. It is optional and can be set to None.

  • Type: int | None

  • Nullable: True

type: Mapped[BaseType]

Relationship to the BaseType model.

This attribute establishes a relationship with the BaseType model, allowing access to the type associated with the word. It is populated based on the type_id foreign key, which links to the primary key of the BaseType table.

  • Type: BaseType

  • Nullable: False

  • Back Population: This relationship is bidirectional, allowing access to all words associated with a given type through the words attribute in the BaseType model.

  • Loading Strategy: The relationship uses a “joined” loading strategy, which means that the related BaseType instance is loaded in the same query as the BaseWord instance for efficiency.

type_id: Mapped[int]

Foreign key referencing the type of the word.

This attribute links the word to its type in the database, establishing a relationship with the BaseType model. It is required and cannot be null.

  • Type: int

  • Nullable: 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

year: Mapped[datetime.date | None]

Year associated with the word.

This attribute represents the year that is relevant to the word, such as the year it was coined or first recorded. It is optional and can be set to None if the year is not specified.

  • Type: datetime.date | None

  • Nullable: True