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
| Class | |
Attribute handling behavior shared by every model. |
| Function | _cast |
Cast a raw value to bool handling common textual forms. |
| Function | _cast |
Cast a raw value to date. |
| Function | _cast |
Cast a raw value to datetime. |
| Function | _cast |
Cast a raw value to a JSON-decoded Python structure. |
| Function | _cast |
Cast a raw value to uuid.UUID. |
| Function | get |
Return the cast handler registered under the given name. |
| Function | serialize |
Convert attribute values into driver-friendly storage values. |
| Constant | _CAST |
Undocumented |
| Constant | _TRUTHY |
Undocumented |
Return the cast handler registered under the given name.
| Parameters | |
cast:str | Cast name declared in a model casts mapping. |
| Returns | |
Callable | Function converting raw values into the cast type. |
| Raises | |
OrmException | If the cast name is not supported. |
def serialize_for_storage(meta:
ModelMetadata, values: dict[ str, Any]) -> dict[ str, Any]:
(source)
¶
Convert attribute values into driver-friendly storage values.
JSON-cast structures stored in non-JSON columns are serialized to strings, and UUID objects targeting non-UUID columns are stringified; every other value passes through unchanged.
| Parameters | |
meta:ModelMetadata | Metadata of the model owning the attributes. |
values:dict | Attribute values to serialize. |
| Returns | |
dict | Values ready to be bound into an SQL statement. |
Undocumented
| Value |
|