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 documentation
Lifecycle event behavior shared by every model.
Listeners are registered per model class and inherited by its subclasses. Listeners of the "before" events (saving, creating, updating, deleting, restoring) abort the operation by returning False, mirroring Eloquent.
| Class Method | flush |
Remove registered listeners from the model. |
| Class Method | observe |
Register every lifecycle method exposed by an observer. |
| Class Method | register |
Register a listener for a model lifecycle event. |
| Async Method | fire |
Dispatch a lifecycle event to its listeners. |
| Class Variable | __slots__ |
Undocumented |
Register a listener for a model lifecycle event.
| Parameters | |
event:str | Event name; one of the supported lifecycle events. |
listener:Callable | Callable receiving the model instance. It may be a coroutine function and, for "before" events, returning False aborts the operation. |
| Returns | |
type | The model class, enabling fluent chaining. |
| Raises | |
OrmException | If the event name is not supported. |