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.

module documentation

Undocumented

Function apply_flash Write a pending flash payload into the session.
Function filter_input Drop credential-like fields from a form payload before flashing it.
Function normalize_errors Coerce any supported error payload into {field: [message, ...]}.
Function queue_bag Merge values into the reserved bag key of a pending flash payload.
Constant _SEQUENCE_TYPES Undocumented
Constant ERRORS_KEY Undocumented
Constant OLD_INPUT_KEY Undocumented
Constant PREVIOUS_URL_KEY Undocumented
Constant SENSITIVE_INPUT_FIELDS Undocumented
def apply_flash(session: ISession, data: Mapping[str, Any]): (source)

Write a pending flash payload into the session.

Reserved bags are routed through their dedicated session methods so they merge with anything already flashed during this request instead of replacing it.

Parameters
session:ISessionSession receiving the flashed values.
data:Mapping[str, Any]Pending flash payload.
Returns
NoneUndocumented
def filter_input(values: Mapping[str, Any]) -> dict[str, Any]: (source)

Drop credential-like fields from a form payload before flashing it.

Parameters
values:Mapping[str, Any]Raw submitted payload.
Returns
dict[str, Any]Copy of values without any field listed in SENSITIVE_INPUT_FIELDS.
def normalize_errors(errors: object) -> dict[str, list[str]]: (source)

Coerce any supported error payload into {field: [message, ...]}.

Accepts a mapping of field to a single message or to a sequence of messages, or an exception exposing a failure attribute with field and message (e.g. ValidationException).

Parameters
errors:objectMapping of errors, or a validation exception.
Returns
dict[str, list[str]]Field-indexed error messages.
Raises
TypeErrorIf errors is neither a mapping nor a validation exception.
def queue_bag(flash: dict[str, Any], key: str, values: Mapping[str, Any]): (source)

Merge values into the reserved bag key of a pending flash payload.

Parameters
flash:dict[str, Any]Pending flash payload owned by a response or a pending view.
key:strReserved bag key.
values:Mapping[str, Any]Entries to merge into the bag.
Returns
NoneUndocumented
_SEQUENCE_TYPES: tuple[type, ...] = (source)

Undocumented

Value
(list, tuple, set, frozenset)
ERRORS_KEY: str = (source)

Undocumented

Value
'_errors'
OLD_INPUT_KEY: str = (source)

Undocumented

Value
'_old_input'
PREVIOUS_URL_KEY: str = (source)

Undocumented

Value
'_previous_url'
SENSITIVE_INPUT_FIELDS: frozenset[str] = (source)

Undocumented

Value
frozenset(set(['_csrf',
               'csrf_token',
               'current_password',
               'new_password',
               'password',
               'password_confirmation']))