Skip to content

Models

CommandExecution

Bases: Model

output_parts_for

output_parts_for(field: str)

All output parts for field ("stdout"/"stderr"), ordered by seq.

Source code in src/django_admin_runner/models.py
def output_parts_for(self, field: str):
    """All output parts for *field* ("stdout"/"stderr"), ordered by seq."""
    return self.output_parts.filter(field=field).order_by("seq")

output_text

output_text(field: str) -> str

Concatenated retained output for field.

Source code in src/django_admin_runner/models.py
def output_text(self, field: str) -> str:
    """Concatenated retained output for *field*."""
    return "".join(part.text for part in self.output_parts_for(field))

output_len

output_len(field: str) -> int

Total retained characters for field.

Source code in src/django_admin_runner/models.py
def output_len(self, field: str) -> int:
    """Total retained characters for *field*."""
    from django.db.models.functions import Length

    return (
        self.output_parts_for(field).aggregate(total=models.Sum(Length("text")))["total"] or 0
    )

CommandOutputPart

Bases: Model

One sealed chunk of command output (at most PART_SIZE characters).

Output is stored as an ordered sequence of immutable parts per (execution, field). Live flushes append at the database level to the single active (highest-seq) part; when a part would exceed PART_SIZE it is sealed and a new empty part becomes active.

RegisteredCommand

Bases: Model

ScheduledCommand

Bases: Model

Library-owned schedule definition — the source of truth.

Rows are materialized into the active runner's native schedule objects (e.g. django-q2 Schedule) via the runner's schedule CRUD API; the native reference is stored in backend_schedule_key. enabled=False removes the native object but keeps this row (audit trail / re-enabling).