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

Render named templates and return HTMLResponse objects.

ViewFactory is the primary entry-point for controllers and other HTTP-layer code that needs to produce HTML responses from templates. It delegates all rendering work to the bound IViewEngine and wraps the output in a framework-native HTMLResponse.

Method __init__ Initialise the factory with a rendering engine.
Method make Prepare a template render as an awaitable, chainable response.
Class Variable __slots__ Undocumented
Instance Variable _engine Undocumented
def __init__(self, engine: IViewEngine): (source)

Initialise the factory with a rendering engine.

Parameters
engine:IViewEngineThe view engine used to render templates.
Returns
NoneUndocumented
def make(self, template: str, **context: Any) -> PendingView: (source)

Prepare a template render as an awaitable, chainable response.

Parameters
template:strTemplate name using dot notation (e.g. 'users.index') or a relative path (e.g. 'users/index.html').
**context:AnyKeyword arguments forwarded as template variables.
Returns
PendingViewAwaitable proxy that renders the template on await and accepts chained response mutators such as withInput(), withErrors(), withFlash(), withCookie() or withoutCookie().
Raises
ViewTemplateNotFoundExceptionWhen the view file cannot be located.
ViewRenderExceptionWhen rendering fails for any reason.

Undocumented