Skip to content

Api reference

components.admin_tools.public.dependencies

AdminToolsDependency

Bases: ABC

Dependencies needed for the Admin Tools component.

get_command_logs abstractmethod

get_command_logs(start_at, end_at)

Implement get_command_logs

Source code in components/admin_tools/public/dependencies.py
@abstractmethod
def get_command_logs(
    self,
    start_at: datetime,
    end_at: datetime,
) -> list[CommandLog]:
    """Implement get_command_logs"""

get_test_data_generation_config abstractmethod

get_test_data_generation_config()

Implement get_test_data_generation_config

Source code in components/admin_tools/public/dependencies.py
@abstractmethod
def get_test_data_generation_config(self) -> TestDataGeneratorConfig:
    """Implement get_test_data_generation_config"""

COMPONENT_NAME module-attribute

COMPONENT_NAME = 'admin_tools'

get_app_dependency

get_app_dependency()

Gets the dependency for the admin_tools component.

Source code in components/admin_tools/public/dependencies.py
def get_app_dependency() -> AdminToolsDependency:
    """Gets the dependency for the admin_tools component."""
    from flask import current_app

    return cast("CustomFlask", current_app).get_component_dependency(COMPONENT_NAME)  # type: ignore[no-any-return]

set_app_dependency

set_app_dependency(dependency)

Sets the dependency for the admin_tools component.

Source code in components/admin_tools/public/dependencies.py
def set_app_dependency(dependency: AdminToolsDependency) -> None:
    """Sets the dependency for the admin_tools component."""
    from flask import current_app

    cast("CustomFlask", current_app).add_component_dependency(
        COMPONENT_NAME, dependency
    )

components.admin_tools.public.test_data_generator

Handler module-attribute

Handler = Handler

ResultViewData module-attribute

ResultViewData = ResultViewData

TestDataGeneratorConfig module-attribute

TestDataGeneratorConfig = TestDataGeneratorConfig

User_email

User_email(current_user)
Source code in components/admin_tools/public/test_data_generator.py
def User_email(current_user) -> factory.LazyAttribute:  # type: ignore[no-untyped-def] # noqa: D103
    def generate_free_email(factory_object: Any) -> str:  # noqa: ARG001
        if current_user:
            prefix: str = _internal_get_email_prefix(current_user.email)
        else:
            prefix = "fixtures"
        return f"{prefix}+user_{uuid4()}@alan.eu"

    return factory.LazyAttribute(generate_free_email)

build_results module-attribute

build_results = build_results

create_data_generation_log module-attribute

create_data_generation_log = create_data_generation_log

execute_fixture_request module-attribute

execute_fixture_request = execute_fixture_request

get_email_prefix module-attribute

get_email_prefix = get_email_prefix

make_company_factory module-attribute

make_company_factory = make_company_factory

patch_factory module-attribute

patch_factory = patch_factory

patch_factory_meta module-attribute

patch_factory_meta = patch_factory_meta

should_not_patch_factories

should_not_patch_factories()
Source code in components/admin_tools/public/test_data_generator.py
def should_not_patch_factories() -> bool:  # noqa: D103
    return not is_stage_mode() and not is_development_mode() and not is_demo_mode()