database.session

Provides accounting specific overrides for some sqlalchemy session methods.

Module Contents

Classes

AccountingSession

Custom methods specific to accounting.

Functions

get_session(→ sqlalchemy.orm.session.Session)

Construct the accounting session.

class database.session.AccountingSession(bind=None, info=None)

Bases: python_accounting.database.session_overrides.SessionOverridesMixin, python_accounting.database.event_listeners.EventListenersMixin, python_accounting.database.accounting_functions.AccountingFunctionsMixin, sqlalchemy.orm.session.Session

Custom methods specific to accounting.

entity

The Entity currently associated with the session. All database queries will be scoped to this entity.

Type:

Entity

entity: python_accounting.models.Entity
database.session.get_session(engine) sqlalchemy.orm.session.Session

Construct the accounting session.

Parameters:

engine – The database engine to create a session for.

Returns:

AccountingSession.