quackamollie.core.database.model.quackamollie_schema module

Module containing all tables of the quackamollie postgresql database schema

class quackamollie.core.database.model.quackamollie_schema.AppPermission(**kwargs)[source]

Bases: TimeStampedModel

Table listing application permissions determining rights to change global dynamic application settings depending on roles.

_sa_class_manager = {'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'role': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'role_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
created_at
id
name
role
role_id
type
updated_at
class quackamollie.core.database.model.quackamollie_schema.AppRole(**kwargs)[source]

Bases: TimeStampedModel

Table listing application roles determining rights of users to change global dynamic application settings

_sa_class_manager = {'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'permissions': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'role_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'users': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
created_at
id
permissions
role_type
updated_at
users
class quackamollie.core.database.model.quackamollie_schema.Chat(**kwargs)[source]

Bases: TimeStampedModel

Table listing chats. It is populated at runtime with Telegram chats registered by users calling the /start command.

_sa_class_manager = {'chat_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chat_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'messages': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'settings': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'users': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
chat_name
chat_type
created_at
id
messages
settings
updated_at
users
class quackamollie.core.database.model.quackamollie_schema.ChatMember(**kwargs)[source]

Bases: TimeStampedModel

Join tables users and chats to handle many-to-many relationship

_sa_class_manager = {'chat_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
chat_id
created_at
updated_at
user_id
class quackamollie.core.database.model.quackamollie_schema.ChatMessage(**kwargs)[source]

Bases: TimeStampedModel

Table listing messages sent by users through Telegram

_sa_class_manager = {'active': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chat': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chat_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'content': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'sent_at_datetime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
active
chat
chat_id
content
created_at
id
sent_at_datetime
updated_at
user
user_id
class quackamollie.core.database.model.quackamollie_schema.ChatSetting(**kwargs)[source]

Bases: TimeStampedModel

Table listing the settings of chats possibly changed at runtime by the users through the /settings command

_sa_class_manager = {'chat': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chat_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chat_type_override': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_config': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_config_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
chat
chat_id
chat_type_override
created_at
id
model_config
model_config_id
updated_at
class quackamollie.core.database.model.quackamollie_schema.ModelConfig(**kwargs)[source]

Bases: TimeStampedModel

Table listing model configurations which are essentially a tuple of a model manager, a model name and an additional model configuration possibly null.

_sa_class_manager = {'config': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'config_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_manager_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_manager_type_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'permissions': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
config
config_name
created_at
id
model_manager_type
model_manager_type_id
model_name
permissions
updated_at
class quackamollie.core.database.model.quackamollie_schema.ModelConfigPermission(**kwargs)[source]

Bases: AppPermission

Table listing permissions specific to model config access depending on roles

_sa_class_manager = {'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'delete': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'hidden': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_config': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'model_config_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'read': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'role': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'role_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'write': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
created_at
delete
hidden
id
model_config
model_config_id
name
read
role
role_id
type
updated_at
write
class quackamollie.core.database.model.quackamollie_schema.User(**kwargs)[source]

Bases: TimeStampedModel

Table listing users. It is autopopulated at startup by the CLI with the bot user and populated at runtime with Telegram users registering through the /start command.

_sa_class_manager = {'app_role': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'app_role_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'chats': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'first_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'full_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'last_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'messages': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'updated_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'username': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
app_role
app_role_id
chats
created_at
first_name
full_name
id
last_name
messages
updated_at
user_type
username