# `orchestrator.pkg.python_orm`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/pkg/python_orm.py`](../../src/orchestrator/pkg/python_orm.py)

5 types · 11 functions · python

## Changing this safely

**No test module imports this.**

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_literal_str`](../../src/orchestrator/pkg/python_orm.py#L110) — reaches **7** symbols · **no test path visible**
- [`_call_name`](../../src/orchestrator/pkg/python_orm.py#L116) — reaches **5** symbols · **no test path visible**
- [`PendingReference`](../../src/orchestrator/pkg/python_orm.py#L70) — reaches **4** symbols · **no test path visible**
- [`PendingAccess`](../../src/orchestrator/pkg/python_orm.py#L89) — reaches **3** symbols · **no test path visible**
- [`PendingColumn`](../../src/orchestrator/pkg/python_orm.py#L64) — reaches **3** symbols · **no test path visible**
- [`_meta_db_table`](../../src/orchestrator/pkg/python_orm.py#L137) — reaches **3** symbols · **no test path visible**
- [`_references_in`](../../src/orchestrator/pkg/python_orm.py#L174) — reaches **3** symbols · **no test path visible**
- [`PendingEntity`](../../src/orchestrator/pkg/python_orm.py#L79) — reaches **2** symbols · **no test path visible**

_16 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `OrmState`

[`src/orchestrator/pkg/python_orm.py:99`](../../src/orchestrator/pkg/python_orm.py#L99)

- **Called by** (1): [`__init__`](../../src/orchestrator/pkg/extractor.py#L161)
- **Fields**: `accesses`, `entities`

### `PendingAccess`

[`src/orchestrator/pkg/python_orm.py:89`](../../src/orchestrator/pkg/python_orm.py#L89)

- **Called by** (1): [`_collect_accesses`](../../src/orchestrator/pkg/python_orm.py#L234)
- **Fields**: `class_name`, `function_id`, `kind`, `provenance`

### `PendingColumn`

[`src/orchestrator/pkg/python_orm.py:64`](../../src/orchestrator/pkg/python_orm.py#L64)

- **Called by** (1): [`_columns_and_refs`](../../src/orchestrator/pkg/python_orm.py#L203)
- **Fields**: `name`, `provenance`

### `PendingEntity`

[`src/orchestrator/pkg/python_orm.py:79`](../../src/orchestrator/pkg/python_orm.py#L79)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)
- **Fields**: `class_name`, `columns`, `module_id`, `provenance`, `references`, `table`

### `PendingReference`

[`src/orchestrator/pkg/python_orm.py:70`](../../src/orchestrator/pkg/python_orm.py#L70)

- **Called by** (1): [`_references_in`](../../src/orchestrator/pkg/python_orm.py#L174)
- **Fields**: `class_name`, `provenance`, `table`

## Functions

### `_call_name`

[`src/orchestrator/pkg/python_orm.py:116`](../../src/orchestrator/pkg/python_orm.py#L116)

- **Called by** (3): [`_collect_accesses`](../../src/orchestrator/pkg/python_orm.py#L234), [`_columns_and_refs`](../../src/orchestrator/pkg/python_orm.py#L203), [`_references_in`](../../src/orchestrator/pkg/python_orm.py#L174)

### `_collect_accesses`

[`src/orchestrator/pkg/python_orm.py:234`](../../src/orchestrator/pkg/python_orm.py#L234)

- **Called by** (2): [`_collect_accesses`](../../src/orchestrator/pkg/python_orm.py#L234), [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)
- **Calls** (5): [`PendingAccess`](../../src/orchestrator/pkg/python_orm.py#L89), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_call_name`](../../src/orchestrator/pkg/python_orm.py#L116), [`_collect_accesses`](../../src/orchestrator/pkg/python_orm.py#L234), `walk`

### `_columns_and_refs`

[`src/orchestrator/pkg/python_orm.py:203`](../../src/orchestrator/pkg/python_orm.py#L203)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)
- **Calls** (6): `Pass`, [`PendingColumn`](../../src/orchestrator/pkg/python_orm.py#L64), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_call_name`](../../src/orchestrator/pkg/python_orm.py#L116), [`_references_in`](../../src/orchestrator/pkg/python_orm.py#L174), `dump`

### `_django_model_base`

[`src/orchestrator/pkg/python_orm.py:127`](../../src/orchestrator/pkg/python_orm.py#L127)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)

### `_django_table`

[`src/orchestrator/pkg/python_orm.py:160`](../../src/orchestrator/pkg/python_orm.py#L160)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)
- **Calls** (1): [`_meta_db_table`](../../src/orchestrator/pkg/python_orm.py#L137)

### `_literal_str`

[`src/orchestrator/pkg/python_orm.py:110`](../../src/orchestrator/pkg/python_orm.py#L110)

- **Called by** (3): [`_meta_db_table`](../../src/orchestrator/pkg/python_orm.py#L137), [`_references_in`](../../src/orchestrator/pkg/python_orm.py#L174), [`_tablename`](../../src/orchestrator/pkg/python_orm.py#L149)

### `_meta_db_table`

[`src/orchestrator/pkg/python_orm.py:137`](../../src/orchestrator/pkg/python_orm.py#L137)

- **Called by** (1): [`_django_table`](../../src/orchestrator/pkg/python_orm.py#L160)
- **Calls** (1): [`_literal_str`](../../src/orchestrator/pkg/python_orm.py#L110)

### `_references_in`

[`src/orchestrator/pkg/python_orm.py:174`](../../src/orchestrator/pkg/python_orm.py#L174)

- **Called by** (1): [`_columns_and_refs`](../../src/orchestrator/pkg/python_orm.py#L203)
- **Calls** (5): [`PendingReference`](../../src/orchestrator/pkg/python_orm.py#L70), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_call_name`](../../src/orchestrator/pkg/python_orm.py#L116), [`_literal_str`](../../src/orchestrator/pkg/python_orm.py#L110), `walk`

### `_tablename`

[`src/orchestrator/pkg/python_orm.py:149`](../../src/orchestrator/pkg/python_orm.py#L149)

- **Called by** (1): [`scan_module`](../../src/orchestrator/pkg/python_orm.py#L268)
- **Calls** (1): [`_literal_str`](../../src/orchestrator/pkg/python_orm.py#L110)

### `emit`

[`src/orchestrator/pkg/python_orm.py:293`](../../src/orchestrator/pkg/python_orm.py#L293)

- **Called by** (1): [`finalize`](../../src/orchestrator/pkg/extractor.py#L193)
- **Calls** (2): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Node`](../../src/orchestrator/pkg/facts.py#L121)

### `scan_module`

[`src/orchestrator/pkg/python_orm.py:268`](../../src/orchestrator/pkg/python_orm.py#L268)

- **Called by** (1): [`extract`](../../src/orchestrator/pkg/extractor.py#L175)
- **Calls** (8): [`PendingEntity`](../../src/orchestrator/pkg/python_orm.py#L79), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_collect_accesses`](../../src/orchestrator/pkg/python_orm.py#L234), [`_columns_and_refs`](../../src/orchestrator/pkg/python_orm.py#L203), [`_django_model_base`](../../src/orchestrator/pkg/python_orm.py#L127), [`_django_table`](../../src/orchestrator/pkg/python_orm.py#L160), [`_tablename`](../../src/orchestrator/pkg/python_orm.py#L149), `walk`

## Imports

`__future__.annotations`, `ast`, `dataclasses.dataclass`, `dataclasses.field`, [`orchestrator.pkg.facts`](../../src/orchestrator/pkg/facts.py#L1)

## Imported by

[`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1)
