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 a nullable delete column without modifying a shared schema. |
| 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 orionis.orm.schema.column.ColumnDefinition | Column definitions keyed by attribute name. |
type, columns: dict[ str, ColumnDefinition]) -> str | None:
(source)
¶
Resolve a nullable delete column without modifying a shared schema.
| Parameters | |
owner:type | Model class declaring its soft-delete policy. |
columns:dict of str to ColumnDefinition | Bound columns belonging to the model's table. |
| Returns | |
str or None | Declared delete column, or None when soft deletion is unavailable. |
| Raises | |
OrmConfigurationException | If a shared schema declares a non-nullable delete column. |
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 typing.Any | Attributes declared in the model class body. |
| Returns | |
orionis.orm.schema.TableDefinition | Resolved table definition for the model. |
| Raises | |
orionis.orm.exceptions.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:type | Class on which the operation is performed. |
name:str | Attribute name requested on the model class. |
| Returns | |
typing.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[orionis.orm.metaclass.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:typing.Any | Additional keyword arguments forwarded to type. |
| Returns | |
type | The created model class with __meta__ attached. |