rattail.db.sess

Database Sessions

class rattail.db.sess.Session[source]

SQLAlchemy session class used for all (normal) app database connections.

This is a subclass of SessionBase.

See the sqlalchemy.orm.Session docs for more info.

Note

WuttJamaican also provides a Session class, however for now Rattail still must define/use its own.

class rattail.db.sess.SessionBase(rattail_config=None, rattail_record_changes=None, continuum_user=None, **kwargs)[source]

Custom SQLAlchemy session base class, which adds some convenience methods related to the SQLAlchemy-Continuum integration.

You should not instantiate this class directly; instead just use Session.

Parameters:

continuum_user – Optional user for Continuum versioning authorship. If specified, the value is passed to set_continuum_user().

set_continuum_user(user_info)[source]

Set the effective Continuum user for the session.

Parameters:

user_info – May be a User instance, or the uuid or username for one.