kepler.models.translation module

The module defines the classes for database models related to translations.

class kepler.models.translation.Language(id, name, locale_name)

Bases: sqlalchemy.ext.declarative.api.Base

The class defines the Language database table used for translatable fields and user’s language setting in the database.

id

The ID of the language.

locale_name

The locale language part of the language.

name

The name of the language.

class kepler.models.translation.Translation(translation_id, language_id, translation)

Bases: sqlalchemy.ext.declarative.api.Base

The class defines the database model for the rows in Translation database table. The table holds translations for various translatable information in the database.

language_id

The language ID of the translation.

translation

The actual string of the translation.

translation_id

The ID of the translation.

kepler.models.translation.translatable_column(nullable=False, unique=False)

The function returns a column for translatable string which is an ID of a translation in Translation table.

Parameters:
  • nullable – Specifies if the column is nullable. Defaults to False.
  • unique – Specifies if the column is unique. Defaults to False.
Returns:

A new translatable column.