Filters

This module provides utility functions for the loglan_core package.

loglan_core.addons.filters.filter_key_by_language(language=None)[source]

Filter the language of the base key.

Parameters:
  • language (str or None) – The language to filter by.

  • None (If)

  • applied. (no language filter will be)

Returns:

A filter condition for the base key’s language.

Return type:

ColumnElement[bool]

loglan_core.addons.filters.filter_key_by_word_cs(key, case_sensitive=False, is_sqlite=False)[source]

Returns a filter condition to select keys containing a specific word.

Parameters:
  • key (str) – The word to filter by.

  • case_sensitive (bool) – Whether to perform a case-sensitive search.

  • is_sqlite (bool) – Whether the database is SQLite.

Returns:

A filter condition to select keys containing a specific word.

Return type:

BinaryExpression

loglan_core.addons.filters.filter_word_by_event_id(event_id)[source]

Returns a filter condition to select words associated with a specific event.

Parameters:

event_id (int | None) – The id of the event to filter by. Defaults to None.

Returns:

A filter condition to select words associated with a specific event.

Return type:

BooleanClauseList