ORIONIS API REFERENCE

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

Awaitable, chainable result of IViewFactory.make.

Rendering is deferred until the object is awaited, so response mutators such as withInput(), withErrors(), withFlash() or withCookie() can be chained directly on the make() call:

return await View.make("auth.login").withErrors(errors)

Every attribute that exists on HTMLResponse is accepted and replayed on the real response once the template has been rendered.

Method __await__ Render the template and apply every queued mutation.
Async Method __flashToSession Write the queued flash data into the active session.
Method __getattr__ Queue a HTMLResponse call to replay after rendering.
Method __init__ Store the rendering intent without performing any work.
Async Method render Render the template into a fully formed HTMLResponse.
Method withErrors Flash validation errors so the errors global can read them.
Method withFlash Flash a status message into the session before rendering.
Method withInput Flash the submitted payload so old() can repopulate the form.
Class Variable __slots__ Undocumented
Instance Variable _context Undocumented
Instance Variable _engine Undocumented
Instance Variable _flash Undocumented
Instance Variable _mutations Undocumented
Instance Variable _template Undocumented
def __await__(self) -> Generator[Any, None, HTMLResponse]: (source)

Render the template and apply every queued mutation.

Returns
Generator[Any, None, HTMLResponse]Generator yielding control until the response is ready.
async def __flashToSession(self): (source)

Write the queued flash data into the active session.

Silently skips when no session is available, e.g. on routes without the session middleware.

Returns
NoneUndocumented
def __getattr__(self, name: str) -> Callable[..., PendingView]: (source)

Queue a HTMLResponse call to replay after rendering.

Parameters
name:strName of the response method being chained.
Returns
Callable[..., PendingView]Callable that records the invocation and returns self.
Raises
AttributeErrorIf HTMLResponse exposes no callable named name.
def __init__(self, engine: IViewEngine, template: str, context: dict[str, Any]): (source)

Store the rendering intent without performing any work.

Parameters
engine:IViewEngineEngine used to render the template once awaited.
template:strTemplate name using dot notation or a relative path.
context:dict[str, Any]Template variables forwarded to the engine.
Returns
NoneUndocumented
async def render(self) -> HTMLResponse: (source)

Render the template into a fully formed HTMLResponse.

Returns
HTMLResponseAn HTTP response whose body is the rendered HTML content.
Raises
ViewTemplateNotFoundExceptionWhen the view file cannot be located.
ViewRenderExceptionWhen rendering fails for any reason.
def withErrors(self, errors: Mapping[str, Any] | Exception) -> PendingView: (source)

Flash validation errors so the errors global can read them.

Parameters
errors:Mapping[str, Any] | ExceptionMapping of field to message(s), or a validation exception.
Returns
PendingViewThe same pending view, allowing fluent chaining.
def withFlash(self, key: str, value: Any = None) -> PendingView: (source)

Flash a status message into the session before rendering.

Writing happens ahead of rendering so this very view can read the value back through the flash() global, and it remains available for the next request.

Parameters
key:strFlash data key.
value:Any, optionalValue to flash.
Returns
PendingViewThe same pending view, allowing fluent chaining.
def withInput(self, values: Mapping[str, Any]) -> PendingView: (source)

Flash the submitted payload so old() can repopulate the form.

Credential-like fields such as password are stripped.

Parameters
values:Mapping[str, Any]Submitted form payload to remember.
Returns
PendingViewThe same pending view, allowing fluent chaining.
__slots__: tuple[str, ...] = (source)

Undocumented

_context: dict[str, Any] = (source)

Undocumented

Undocumented

Undocumented

Undocumented

_template: str = (source)

Undocumented