database.session
Provides accounting specific overrides for some sqlalchemy session methods.
Module Contents
Classes
Custom methods specific to accounting. |
Functions
|
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.SessionCustom methods specific to accounting.
- entity
The Entity currently associated with the session. All database queries will be scoped to this entity.
- Type:
- 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.