Skip to content

angee.resources.managers

QuerySet and manager APIs for the resource ledger model.

ResourceQuerySet

python
class ResourceQuerySet(models.QuerySet[Any])

QuerySet methods for validating, loading, and diffing resources.

validate_addons

python
def validate_addons(addons: Iterable[Any],
                    *,
                    tiers: Iterable[object] | None = None) -> ValidationResult

Validate selected addon resource files without saving rows.

load_addons

python
def load_addons(addons: Iterable[Any],
                *,
                tiers: Iterable[object],
                allow_non_dev: bool = False,
                dry_run: bool = False) -> LoadResult

Load selected addon resource tiers idempotently.

diff_addons

python
def diff_addons(
        addons: Iterable[Any],
        *,
        tiers: Iterable[object] | None = None) -> tuple[tuple[str, int], ...]

Return resource display names and parsed row counts.

counts_by_addon

python
def counts_by_addon() -> dict[str, int]

Return ledger row counts keyed by source addon (the dotted name).

The ledger is untyped (no rebac_resource_type); the elevated read is bracketed in system_context so it is explicit and audited. Callers own the access gate (e.g. the platform console's platform/explorer read).

ledger_page

python
def ledger_page(*, limit: int) -> list[Any]

Return up to limit ledger rows in the model's declared order.

A hard limit bounds the fetch and the GraphQL payload — the ledger grows one row per imported resource. The read is elevated/audited as in counts_by_addon; callers own the access gate.

ResourceManager

Manager exposing resource ledger operations.

Released under the AGPL-3.0 License.