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

class IViewFactory(ABC): (source)

Known subclasses: orionis.view.factory.ViewFactory

View In Hierarchy

Contract for the view factory.

Callers receive a orionis.view.pending.PendingView synchronously. Await that value to render a named template and obtain an orionis.http.HTMLResponse ready to return from an HTTP controller.

Method make Prepare a template render as an awaitable, chainable response.
Class Variable __slots__ Declare that this class introduces no additional instance slots.
def make(self, template: str, *, status_code: HTTPStatus | int = 200, headers: Mapping[str, str] | None = None, background: BackgroundTask | None = None, context: Mapping[str, Any] | None = None, **variables: Any) -> PendingView: (source)

Prepare a template render as an awaitable, chainable response.

Notes

Template lookup and rendering errors are raised when the returned value is awaited, rather than when this method prepares it. Response options are also validated on await; chained mutations are applied after the initial options, in call order.

Parameters
template:strTemplate name using dot notation (e.g. 'users.index') or a direct path relative to a configured template directory.
status_code:orionis.http.enums.HTTPStatus | int, optionalHTTP status code for the rendered response.
headers:collections.abc.Mapping[str, str] | None, optionalResponse headers. The SSR marker is added when not supplied.
background:orionis.background.BackgroundTask | None, optionalTask to run after the response is sent.
context:collections.abc.Mapping[str, typing.Any] | None, optionalTemplate variables, including names reserved for response options.
**variables:typing.AnyAdditional template variables, overriding matching context entries.
Returns
orionis.view.pending.PendingViewAwaitable proxy that resolves to an orionis.http.HTMLResponse and accepts chained response mutators such as withStatusCode() and withFlash().
Raises
TypeErrorIf context is neither a mapping nor None.
__slots__: tuple = (source)

Declare that this class introduces no additional instance slots.