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

Constructor: ErrorBag(app)

View In Hierarchy

Read-only view over the validation errors flashed for this request.

Exposed to templates as the errors global. Every method is a coroutine, which Jinja2 awaits transparently in async environments:

{% if errors.any() %}{{ errors.first('email') }}{% endif %}
Method __init__ Bind the bag to the application container.
Async Method __resolve Return the flashed error mapping, or an empty mapping.
Async Method all Return every error grouped by field.
Async Method any Report whether at least one field failed validation.
Async Method first Return the first message for field, or the first of any field.
Async Method get Return every message recorded for field.
Async Method has Report whether field has at least one error.
Class Variable __slots__ Undocumented
Instance Variable _app Undocumented
def __init__(self, app: IApplication): (source)

Bind the bag to the application container.

Parameters
app:IApplicationApplication container used for service resolution.
Returns
NoneUndocumented
async def __resolve(self) -> dict[str, list[str]]: (source)

Return the flashed error mapping, or an empty mapping.

Returns
dict[str, list[str]]Field-indexed error messages.
async def all(self) -> dict[str, list[str]]: (source)

Return every error grouped by field.

Returns
dict[str, list[str]]Field-indexed error messages.
async def any(self) -> bool: (source)

Report whether at least one field failed validation.

Returns
boolTrue when the bag holds any message.
async def first(self, field: str | None = None) -> str: (source)

Return the first message for field, or the first of any field.

Parameters
field:str | None, optionalForm field name. When omitted, the first message of the whole bag is returned, which suits a single summary line.
Returns
strThe message, or an empty string when there is none.
async def get(self, field: str) -> list[str]: (source)

Return every message recorded for field.

Parameters
field:strForm field name.
Returns
list[str]Messages for the field, empty when it is valid.
async def has(self, field: str) -> bool: (source)

Report whether field has at least one error.

Parameters
field:strForm field name.
Returns
boolTrue when the field failed validation.
__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented