add bot entity's events, external bot command call
Some checks failed
Build Docs / changes (push) Failing after 2s
Build Docs / build-docs (push) Has been skipped
Build Docs / deploy-docs (push) Has been skipped

This commit is contained in:
Alexander Kalinovsky
2025-04-30 19:21:29 +07:00
parent a4999159b9
commit 90652b9f3f
18 changed files with 555 additions and 260 deletions

View File

@@ -122,7 +122,7 @@ class _BaseFieldDescriptor:
localizable: bool = False
bool_false_value: str | LazyProxy = "no"
bool_true_value: str | LazyProxy = "yes"
ep_form: str | None = None
ep_form: str | Callable[["BotContext"], str] | None = None
ep_parent_field: str | None = None
ep_child_field: str | None = None
dt_type: Literal["date", "datetime"] = "date"
@@ -195,9 +195,20 @@ class _BaseEntityDescriptor:
EntityPermission.DELETE_ALL: [RoleBase.SUPER_USER],
}
)
before_create: Callable[["BotContext"], Union[bool, str]] | None = None
before_create_save: (
Callable[["BotEntity", "BotContext"], Union[bool, str]] | None
) = None
before_update_save: (
Callable[[dict[str, Any], dict[str, Any], "BotContext"], Union[bool, str]]
| None
) = None
before_delete: Callable[["BotEntity", "BotContext"], Union[bool, str]] | None = None
on_created: Callable[["BotEntity", "BotContext"], None] | None = None
on_deleted: Callable[["BotEntity", "BotContext"], None] | None = None
on_updated: Callable[["BotEntity", "BotContext"], None] | None = None
on_updated: Callable[[dict[str, Any], "BotEntity", "BotContext"], None] | None = (
None
)
@dataclass(kw_only=True)
@@ -220,6 +231,7 @@ class CommandCallbackContext[UT: UserBase]:
)
message_text: str | None = None
register_navigation: bool = True
clear_navigation: bool = False
message: Message | CallbackQuery
callback_data: ContextData
db_session: AsyncSession