core.orm.mixins.timestamp

Classes

TimestampMixin

Mixin providing created/modified timestamps for all records.

Module Contents

class core.orm.mixins.timestamp.TimestampMixin[source]

Mixin providing created/modified timestamps for all records.

The columns are deferred loaded as this is primarily for logging and future forensics.

static timestamp() datetime.datetime[source]
created: sqlalchemy.orm.Mapped[datetime.datetime][source]
modified: sqlalchemy.orm.Mapped[datetime.datetime | None][source]
force_update() None[source]

Forces the model to update by changing the modified parameter.

last_change() datetime.datetime[source]

Returns the self.modified if not NULL, else self.created.

classmethod _last_change_expression() sqlalchemy.sql.elements.ColumnElement[datetime.datetime][source]