.. This page is generated by scripts/generate_dataclass_docs.py. Do not edit manually. Models / Mapping ================ .. automodule:: teksi_hooks.models.mapping AttributeMapping ---------------- .. autoclass:: teksi_hooks.models.mapping.AttributeMapping :members: Fields ~~~~~~ ``canonical_class_id`` Type: ``str`` Canonical class identifier containing the target attribute. ``canonical_attr_id`` Type: ``str`` Canonical attribute identifier receiving the mapped source value. ``foreign_key`` Type: ``ForeignKeyMapping | None`` Optional reference metadata used when the canonical target attribute stores a foreign-key reference. ``values`` Type: ``Mapping[str, ValueMapping]`` Optional static value mappings keyed by source-model value. ``value_list`` Type: ``ValueListMapping | None`` Optional database-backed value-list translation. The source value is matched using the configured mapping attribute and translated to the configured canonical value attribute. ClassMapping ------------ .. autoclass:: teksi_hooks.models.mapping.ClassMapping :members: Fields ~~~~~~ ``canonical_class_id`` Type: ``str | None`` Optional primary canonical class identifier represented by the source class. This may be omitted for function-backed or extension-only mappings. ``identity`` Type: ``CanonicalIdentityMapping | None`` Optional primary identity override for the class. Missing source or canonical identity attributes are inherited from the model defaults during mapping resolution. ``identities`` Type: ``Mapping[str, CanonicalIdentityMapping | None]`` Identity mappings keyed by canonical target class. A null mapping declares the target class while inheriting the complete model-default identity. A partial mapping may override the canonical or source identity attribute. ``attributes`` Type: ``Mapping[str, AttributeMapping]`` Declarative attribute mappings keyed by source runtime attribute identifier. For ili2pg imports this is the actual SQLAlchemy or ili2pg column name, which may differ from the original INTERLIS attribute name. ``relations`` Type: ``Mapping[str, RelationMapping]`` Class-specific canonical relation mappings keyed by stable canonical relation identifier. These mappings override model-default relations with the same identifier. ``localisations`` Type: ``Mapping[str, str]`` Exact source-model class identifiers keyed by source language. Values are executable model identifiers rather than translated display labels. ``function`` Type: ``FunctionMapping | None`` Optional database-backed class projection function. The function receives configured source-row values and returns the complete canonical JSONB effect document. ForeignKeyMapping ----------------- .. autoclass:: teksi_hooks.models.mapping.ForeignKeyMapping :members: Fields ~~~~~~ ``referenced_class_id`` Type: ``str`` Canonical identifier of the referenced class. Corresponds to a class or table in the internal semantic model. ``referenced_attribute_id`` Type: ``str`` Canonical identifier of the referenced attribute. Defaults to the canonical object identifier `obj_id`. FunctionMapping --------------- .. autoclass:: teksi_hooks.models.mapping.FunctionMapping :members: Fields ~~~~~~ ``schema`` Type: ``str`` Database schema containing the mapping function. Example: `tww_app`. ``name`` Type: ``str`` Database function name implementing the mapping. Example: `fct_agxx_gepknoten_mapping_jsonb`. ``parameters`` Type: ``Mapping[str, str]`` Function parameter mappings keyed by database function parameter name. Values identify source-row expressions or source-model attributes. The special value `$row` passes the complete source row. MappingDefaults --------------- .. autoclass:: teksi_hooks.models.mapping.MappingDefaults :members: Fields ~~~~~~ ``identity`` Type: ``CanonicalIdentityMapping`` Default source-to-canonical identity mapping. Class-level target identities may override either attribute. ``identities`` Type: ``Mapping[str, CanonicalIdentityMapping]`` Default identity mappings keyed by canonical target class. An identity describes how effects address a target row and does not independently require that row to exist. ``attributes`` Type: ``Mapping[str, AttributeMapping]`` Default attribute mappings keyed by source-model runtime attribute identifier. A default mapping applies to a class only when that source class defines the source attribute. ``relations`` Type: ``Mapping[str, RelationMapping]`` Default canonical relation mappings keyed by stable canonical relation identifier. ``inherit_from`` Type: ``str | None`` Optional source-model mapping identifier inherited by this model. Inherited defaults are resolved before local overrides. Mapping inheritance must be acyclic. ModelMapping ------------ .. autoclass:: teksi_hooks.models.mapping.ModelMapping :members: Fields ~~~~~~ ``defaults`` Type: ``MappingDefaults`` Default identities, attributes and relations inherited by classes in this source model. ``classes`` Type: ``Mapping[str, ClassMapping]`` Class mappings keyed by source-model class identifier or stable mapping identifier, according to the selected source-model mapping contract. ``is_ssot`` Type: ``bool`` Whether this model mapping describes a canonical single-source-of-truth model. ``languages`` Type: ``frozenset[str]`` Source languages explicitly supported by this model mapping. An unavailable requested language must not be silently replaced by another language. ModelMappings ------------- .. autoclass:: teksi_hooks.models.mapping.ModelMappings :members: Fields ~~~~~~ ``models`` Type: ``Mapping[str, ModelMapping]`` Model mappings keyed by stable source-model mapping identifier. Example identifiers include `agxx`, `sia405_abwasser`, `dss` and `vsa_kek`. RelationContext --------------- .. autoclass:: teksi_hooks.models.mapping.RelationContext :members: Fields ~~~~~~ ``relation`` Type: ``type`` SQLAlchemy ORM relation generated for the source model. ``class_mapping`` Type: ``ClassMapping`` Resolved mapping for the source-model class represented by the ORM relation. RelationMapping --------------- .. autoclass:: teksi_hooks.models.mapping.RelationMapping :members: Fields ~~~~~~ ``referenced_class_id`` Type: ``str`` Canonical identifier of the class referenced by the relation. Example: `organisation`. ``referenced_attribute_id`` Type: ``str`` Canonical identifier of the referenced target attribute. Defaults to `obj_id`. ``localisations`` Type: ``Mapping[str, str]`` Exact source-model relation identifiers keyed by source language. Example: `{'de': 'DatenbewirtschafterRef'}`. ValueListMapping ---------------- .. autoclass:: teksi_hooks.models.mapping.ValueListMapping :members: Fields ~~~~~~ ``relation`` Type: ``str`` Qualified database relation used for value translation. Example: `tww_vl.measure_category_import_rel_agxx`. ``mapping_attribute`` Type: ``str`` Relation attribute matched against the submitted source-model value. Example: `value_de`. ``value_attribute`` Type: ``str`` Relation attribute containing the resulting canonical value. Defaults to `code`. ValueMapping ------------ .. autoclass:: teksi_hooks.models.mapping.ValueMapping :members: Fields ~~~~~~ ``canonical_value_id`` Type: ``int`` Canonical value identifier. Corresponds to a value-list code or database value identifier. ``value`` Type: ``str`` Source-model value mapped to the canonical value. For a single-source-of-truth model, this may be the canonical English value associated with the canonical code.