Interfaces Overview¶
Interfaces define how managers store or compute data. They encapsulate persistence logic, conversion between Django models and managers, and the inputs required to instantiate a manager.
GeneralManager ships with four main interface flavours:
- Database interfaces persist records to relational databases.
- Existing model interfaces wrap legacy Django models without generating new tables.
- Read-only interfaces synchronise static datasets from JSON.
- Calculation interfaces compute values on the fly from inputs and related managers.
- Request interfaces connect managers to remote HTTP-style services through declarative request operations and filter mappings.
All interfaces inherit from general_manager.interface.base_interface.InterfaceBase, which provides shared behaviour such as identification, validation, and integration with the dependency tracker.
Understanding the capabilities of each interface helps you pick the right tool for each domain object.
Module layout¶
The interface layer is now organised by responsibility:
general_manager.interface.interfacescontains the concrete interface classes (also re-exported viageneral_manager.interfacefor convenience).general_manager.interface.bundlesdefines reusable capability sets such asORM_WRITABLE_CAPABILITIESandREAD_ONLY_CAPABILITIES.general_manager.interface.capabilitiesholds the capability implementations (grouped into subpackages likeorm/,read_only/, andcalculation/) plus utilities undercapabilities/orm_utils.general_manager.interface.manifestsowns the manifest + builder pipeline that wires capabilities onto interfaces.general_manager.interface.utilshosts shared plumbing such as the ORM base models, protocol definitions, and error helpers, whilegeneral_manager.interface.infrastructureimplements the startup-hook and system-check registries.
Capability-first interfaces¶
Interfaces now operate in a capability-first mode. Each class declares the capabilities it needs, and the manifest/builder pipeline wires those capabilities at runtime. Read the dedicated guide in capability-first interfaces and see the how-to articles on creating custom interface types and custom capabilities for step-by-step instructions.