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

Known subclasses: orionis.orm.Model

View In Hierarchy

Soft delete behavior shared by every model.

A model opts in by declaring soft_deletes = True together with a deleted_at column. Deleting then stamps that column instead of removing the row, queries exclude stamped rows by default, and the row can be brought back with restore.

Async Method _performSoftDelete Stamp the soft delete column of the persisted row.
Async Method forceDelete Delete the row permanently, ignoring soft deletes.
Async Method restore Bring a soft deleted row back by clearing its delete stamp.
Method trashed Report whether the instance is currently soft deleted.
Class Variable __slots__ Undocumented
async def _performSoftDelete(self, timestamp: datetime) -> bool: (source)

Stamp the soft delete column of the persisted row.

Parameters
timestamp:datetimeValue written into the soft delete column.
Returns
boolTrue when the row was stamped.
Raises
QueryExceptionIf the statement fails to execute.
async def forceDelete(self) -> bool: (source)

Delete the row permanently, ignoring soft deletes.

Returns
boolTrue when a row was removed, False for unsaved models or when a listener vetoed the operation.
Raises
QueryExceptionIf the statement fails to execute.
async def restore(self) -> bool: (source)

Bring a soft deleted row back by clearing its delete stamp.

Returns
boolTrue when the row was restored, False when the model does not soft delete, was never persisted, or a listener vetoed the operation.
Raises
QueryExceptionIf the statement fails to execute.
def trashed(self) -> bool: (source)

Report whether the instance is currently soft deleted.

Returns
boolTrue when the soft delete column carries a timestamp.
__slots__: tuple = (source)
overridden in orionis.orm.Model

Undocumented