Skip to content

Class tigrbl.orm.mixins.lifecycle.LastUsed

tigrbl.orm.mixins.lifecycle.LastUsed

last_used_at class-attribute instance-attribute

last_used_at = acol(
    spec=ColumnSpec(
        storage=S(
            type_=TZDateTime,
            nullable=True,
            onupdate=tzutcnow,
        ),
        field=F(py_type=datetime),
        io=IO(out_verbs=("read", "list", "create")),
    )
)

touch

touch()

Mark the object as used now.

Source code in tigrbl/orm/mixins/lifecycle.py
40
41
42
def touch(self) -> None:
    """Mark the object as used now."""
    self.last_used_at = tzutcnow()