39 lines
900 B
Python
39 lines
900 B
Python
|
|
"""Public contract for the entity_links plugin.
|
||
|
|
|
||
|
|
Exposes only the symbols that other builtins plugins need.
|
||
|
|
Importers should use::
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract
|
||
|
|
el = get_contract("entity_links")
|
||
|
|
if el:
|
||
|
|
# use el.EntityLink
|
||
|
|
|
||
|
|
instead of importing from internal modules directly.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract_registry
|
||
|
|
from app.plugins.builtins.entity_links.models import EntityLink
|
||
|
|
|
||
|
|
|
||
|
|
class EntityLinksContract:
|
||
|
|
"""Public API surface for the entity_links plugin."""
|
||
|
|
|
||
|
|
contract_name = "entity_links"
|
||
|
|
|
||
|
|
# ─── models (read-only for queries) ───
|
||
|
|
EntityLink = EntityLink
|
||
|
|
|
||
|
|
|
||
|
|
# ─── self-registration ───
|
||
|
|
|
||
|
|
_contract = EntityLinksContract()
|
||
|
|
get_contract_registry().register("entity_links", _contract)
|
||
|
|
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
"EntityLinksContract",
|
||
|
|
"EntityLink",
|
||
|
|
]
|