THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class ModelMeta(type): (source)
Constructor: ModelMeta(name, bases, namespace, **kwargs)
Metaclass discovering model columns and building their metadata.
At class creation time the metaclass collects column definitions (including inherited ones), removes them from the class namespace so instance attribute access reaches the attribute store, derives the table name and primary key, and precompiles cast handlers.
| Static Method | _behaviour |
Classify a method name as an accessor, mutator, or local scope. |
| Static Method | _collect |
Discover accessors, mutators, and local scopes of a model. |
| Static Method | _collect |
Merge cast declarations across the model hierarchy. |
| Static Method | _collect |
Collect column definitions from bases and the class namespace. |
| Static Method | _collect |
Collect and detach column declarations from an abstract class. |
| Static Method | _inherit |
Copy the lifecycle listeners declared by ancestor models. |
| Static Method | _inherit |
Copy the global scopes declared by ancestor models. |
| Static Method | _resolve |
Resolve the primary key from declarations or column flags. |
| Static Method | _resolve |
Resolve the shared table definition or inline model columns. |
| Static Method | _resolve |
Resolve the table name from the declaration or the class name. |
| Method | __getattr__ |
Forward chainable builder entry points from the model class. |
| Method | __new__ |
Create the model class and attach its metadata. |
type, namespace: dict[ str, Any]) -> dict[ str, ColumnDefinition]:
(source)
¶
Collect column definitions from bases and the class namespace.
Own declarations are removed from the class so instance access is served by the model attribute store.
| Parameters | |
owner:type | Class being created. |
namespace:dict | Class namespace as declared in the class body. |
| Returns | |
dict of str to ColumnDefinition | Column definitions keyed by attribute name. |
type, namespace: dict[ str, Any]) -> dict[ str, ColumnDefinition]:
(source)
¶
Collect and detach column declarations from an abstract class.
| Parameters | |
owner:type | Abstract class being created. |
namespace:dict | Class namespace as declared in the class body. |
| Returns | |
dict of str to ColumnDefinition | Columns deferred to concrete descendants. |
Resolve the shared table definition or inline model columns.
| Parameters | |
owner:type | Model class being created. |
name:str | Name of the model class. |
namespace:dict of str to Any | Attributes declared in the model class body. |
| Returns | |
TableDefinition | Resolved table definition for the model. |
| Raises | |
OrmConfigurationException | If the shared definition is invalid, conflicts with model settings, or is combined with inline column declarations. |
Forward chainable builder entry points from the model class.
Enables the Eloquent-style static API, e.g. User.where(...) starts a builder transparently.
| Parameters | |
| cls | Undocumented |
name:str | Attribute name requested on the model class. |
| Returns | |
Any | Bound builder method for whitelisted entry points, or a bound local scope declared by the model. |
| Raises | |
AttributeError | If the attribute is neither a forwarded builder method nor a local scope. |
type[ ModelMeta], name: str, bases: tuple[ type, ...], namespace: dict[ str, Any], **kwargs: Any) -> type:
(source)
¶
Create the model class and attach its metadata.
| Parameters | |
mcs:type[ModelMeta] | Metaclass creating the model, including specialized subclasses. |
name:str | Name of the class being created. |
bases:tuple of type | Base classes of the class being created. |
namespace:dict | Class namespace as declared in the class body. |
**kwargs:Any | Additional keyword arguments forwarded to type. |
| Returns | |
type | The created model class with __meta__ attached. |