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 IViewEnvironment(ABC): (source)

Known subclasses: orionis.view.environment.ViewEnvironment

View In Hierarchy

Contract for the view-environment wrapper.

The implementation is the sole authority for configuring the underlying template engine's environment (loaders, caches, globals, filters, tests, and extensions). No other class should access the engine environment directly.

Method addExtension Register a Jinja2 extension class with the environment.
Method addFilter Register a filter callable that templates can apply with |.
Method addGlobal Register a global variable or callable available in all templates.
Method addTest Register a test callable used in Jinja2 is expressions.
Method getJinjaEnvironment Return the underlying Jinja2 Environment instance.
Class Variable __slots__ Undocumented
def addExtension(self, extension: Any): (source)

Register a Jinja2 extension class with the environment.

Parameters
extension:AnyA Jinja2 Extension subclass or its dotted import path.
Returns
NoneUndocumented
Raises
ViewExceptionWhen the extension cannot be registered.
def addFilter(self, name: str, callback: Callable): (source)

Register a filter callable that templates can apply with |.

Parameters
name:strFilter name used inside template expressions (e.g. | slug).
callback:CallableFunction applied to the piped value. The first argument receives the value being filtered.
Returns
NoneUndocumented
def addGlobal(self, name: str, value: Any): (source)

Register a global variable or callable available in all templates.

Parameters
name:strIdentifier used to reference the value inside templates.
value:AnyValue or callable to expose as a template global.
Returns
NoneUndocumented
def addTest(self, name: str, callback: Callable): (source)

Register a test callable used in Jinja2 is expressions.

Parameters
name:strTest name used in template expressions (e.g. is odd).
callback:CallableFunction that receives the tested value and returns a bool.
Returns
NoneUndocumented
def getJinjaEnvironment(self) -> Any: (source)

Return the underlying Jinja2 Environment instance.

Access is intentionally restricted to this method so that all configuration changes flow through the typed helpers above.

Returns
jinja2.EnvironmentThe configured Jinja2 environment.