Skip to content

Context

is_admin_runner

is_admin_runner() -> bool

Return True when called during an admin-runner command execution.

Source code in src/django_admin_runner/context.py
def is_admin_runner() -> bool:
    """Return ``True`` when called during an admin-runner command execution."""
    return _execution_ctx.get() is not None

set_result_html

set_result_html(html: str) -> None

Store html as the rich result for the current execution.

No-op when called outside an admin-runner execution. Last writer wins.

Source code in src/django_admin_runner/context.py
def set_result_html(html: str) -> None:
    """Store *html* as the rich result for the current execution.

    No-op when called outside an admin-runner execution.  Last writer wins.
    """
    ctx = _execution_ctx.get()
    if ctx is not None:
        ctx["result_html"] = html