wutta_continuum.util

SQLAlchemy-Continuum utilities

wutta_continuum.util.model_transaction_query(instance, session=None, model_class=None)[source]

Make a query capable of finding all SQLAlchemy-Continuum transaction records associated with the given model instance.

Parameters:
  • instance – Instance of a versioned data model.

  • session – Optional db session to use for the query. If not specified, will be obtained from the instance.

  • model_class – Optional data model class to query. If not specified, will be obtained from the instance.

Returns:

SQLAlchemy query object. Note that it will not have an ORDER BY clause yet.

wutta_continuum.util.render_operation_type(operation_type)[source]

Render a SQLAlchemy-Continuum operation_type from a version record, for display to user.

Parameters:

operation_type

Value of same name from a version record. Must be one of:

  • sqlalchemy_continuum:sqlalchemy_continuum.operation.Operation.INSERT

  • sqlalchemy_continuum:sqlalchemy_continuum.operation.Operation.UPDATE

  • sqlalchemy_continuum:sqlalchemy_continuum.operation.Operation.DELETE

Returns:

Display name for the operation type, as string.