Skip to content

angee.data.field_classification

Django field classification and vocabulary for Angee data descriptions.

RESOURCE_FIELD_KINDS

Supported resource field kind names.

RESOURCE_FIELD_SCALARS

Supported GraphQL scalar families in data-resource field metadata.

RESOURCE_FIELD_WIDGETS

Widget vocabulary owned by backend data-resource metadata.

is_to_many_relation

python
def is_to_many_relation(field: models.Field[Any, Any]) -> bool

Return whether a Django field represents a to-many relation path.

is_to_one_relation

python
def is_to_one_relation(field: models.Field[Any, Any]) -> bool

Return whether field is a forward to-one relation.

resource_field_kind

python
def resource_field_kind(field: models.Field[Any, Any] | None,
                        *,
                        has_relation_axis: bool = False,
                        is_list: bool = False,
                        is_enum: bool = False,
                        is_object: bool = False,
                        projected_as_scalar: bool = False) -> str

Return the coarse field kind used by data-resource metadata.

A to-one relation classifies by how the node projects it: as a nested object (is_object) or group axis (has_relation_axis) it is a relation; as a bare scalar id (projected_as_scalar — an ID with no subfields) it is a scalar LEAF so the detail/form query selects it without an invalid sub-selection, while still carrying relation metadata (target label + scalar-id widget). Absent a known wire projection (model reconstruction with no surface), a relation stays an object relation.

model_field_scalar

python
def model_field_scalar(field: models.Field[Any, Any]) -> str | None

Return the GraphQL scalar a Django field's column type maps to, or None.

is_archive_field

python
def is_archive_field(field: models.Field[Any, Any] | None) -> bool

Return whether field is the :class:~angee.base.mixins.ArchiveMixin flag.

The archive vocabulary is name-based — one column name across the platform (:data:angee.base.mixins.ARCHIVE_FLAG_FIELD) — so any model composing ArchiveMixin is recognised by that column and marked archivable in resource metadata. A same-typed boolean under a different contract (a soft-delete is_trashed, an enablement is_enabled/is_active) is deliberately not matched.

money_currency_field

python
def money_currency_field(field: models.Field[Any, Any] | None) -> str | None

Return the currency path a field declares for money metadata, if any.

resource_field_widget

python
def resource_field_widget(field: models.Field[Any, Any] | None,
                          kind: str) -> str | None

Return the default rendered widget owned by the field classification.

Released under the AGPL-3.0 License.