Skip to content

Hooks

HooksMixin - Contains abstract methods for creating hooks.

HooksMixin

A set of abstract methods for creating hooks.

Source code in src\ramifice\paladins\hooks.py
class HooksMixin:
    """A set of abstract methods for creating hooks."""

    @abstractmethod
    async def pre_create(self) -> None:
        """Called before a new document is created in the database."""

    @abstractmethod
    async def post_create(self) -> None:
        """Called after a new document has been created in the database."""

    @abstractmethod
    async def pre_update(self) -> None:
        """Called before updating an existing document in the database."""

    @abstractmethod
    async def post_update(self) -> None:
        """Called after an existing document in the database is updated."""

    @abstractmethod
    async def pre_delete(self) -> None:
        """Called before deleting an existing document in the database."""

    @abstractmethod
    async def post_delete(self) -> None:
        """Called after an existing document in the database has been deleted."""

post_create() abstractmethod async

Called after a new document has been created in the database.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def post_create(self) -> None:
    """Called after a new document has been created in the database."""

post_delete() abstractmethod async

Called after an existing document in the database has been deleted.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def post_delete(self) -> None:
    """Called after an existing document in the database has been deleted."""

post_update() abstractmethod async

Called after an existing document in the database is updated.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def post_update(self) -> None:
    """Called after an existing document in the database is updated."""

pre_create() abstractmethod async

Called before a new document is created in the database.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def pre_create(self) -> None:
    """Called before a new document is created in the database."""

pre_delete() abstractmethod async

Called before deleting an existing document in the database.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def pre_delete(self) -> None:
    """Called before deleting an existing document in the database."""

pre_update() abstractmethod async

Called before updating an existing document in the database.

Source code in src\ramifice\paladins\hooks.py
@abstractmethod
async def pre_update(self) -> None:
    """Called before updating an existing document in the database."""