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
def is_to_many_relation(field: models.Field[Any, Any]) -> boolReturn whether a Django field represents a to-many relation path.
is_to_one_relation
def is_to_one_relation(field: models.Field[Any, Any]) -> boolReturn whether field is a forward to-one relation.
resource_field_kind
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) -> strReturn 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
def model_field_scalar(field: models.Field[Any, Any]) -> str | NoneReturn the GraphQL scalar a Django field's column type maps to, or None.
is_archive_field
def is_archive_field(field: models.Field[Any, Any] | None) -> boolReturn 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
def money_currency_field(field: models.Field[Any, Any] | None) -> str | NoneReturn the currency path a field declares for money metadata, if any.
resource_field_widget
def resource_field_widget(field: models.Field[Any, Any] | None,
kind: str) -> str | NoneReturn the default rendered widget owned by the field classification.