# Path: sqlalchemy_continuum/utils.py
# def adapt_columns(expr):
#     return VersioningClauseAdapter().traverse(expr)
# 
# def option(obj_or_class, option_name):
#     """
#     Return the option value of given option for given versioned object or
#     class.
# 
#     :param obj_or_class: SQLAlchemy declarative model object or class
#     :param option_name: The name of an option to return
#     """
#     if isinstance(obj_or_class, AliasedClass):
#         obj_or_class = sa.inspect(obj_or_class).mapper.class_
#     cls = obj_or_class if isclass(obj_or_class) else obj_or_class.__class__
#     if not hasattr(cls, '__versioned__'):
#         cls = parent_class(cls)
#     return get_versioning_manager(cls).option(
#         cls, option_name
#     )


from copy import copy
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import column_property
from sqlalchemy_utils.functions import get_declarative_base
from .utils import adapt_columns, option
from .version import VersionClassBase
import six
import sqlalchemy as sa
        if not hasattr(self.version_class, 'transaction'):
            self.version_class.transaction = sa.orm.relationship(
                tx_class,
                primaryjoin=tx_class.id == transaction_column,
                foreign_keys=[transaction_column],
            )

    def base_classes(self):
        """
        Returns all base classes for history model.
        """
        return (version_base(self.manager, self.model), )

    def inheritance_args(self, cls, version_table, table):
        """
        Return mapper inheritance args for currently built history model.
        """
        args = {}

        if not sa.inspect(self.model).single:
            parent = find_closest_versioned_parent(
                self.manager, self.model
            )
            if parent:
                # The version classes do not contain foreign keys, hence we
                # need to map inheritance condition manually for classes that
                # use joined table inheritance
                if parent.__table__.name != table.name:
                    mapper = sa.inspect(self.model)


# Path: sqlalchemy_continuum/utils.py
# def adapt_columns(expr):
#     return VersioningClauseAdapter().traverse(expr)
# 
# def option(obj_or_class, option_name):
#     """
#     Return the option value of given option for given versioned object or
#     class.
# 
#     :param obj_or_class: SQLAlchemy declarative model object or class
#     :param option_name: The name of an option to return
#     """
#     if isinstance(obj_or_class, AliasedClass):
#         obj_or_class = sa.inspect(obj_or_class).mapper.class_
#     cls = obj_or_class if isclass(obj_or_class) else obj_or_class.__class__
#     if not hasattr(cls, '__versioned__'):
#         cls = parent_class(cls)
#     return get_versioning_manager(cls).option(
#         cls, option_name
#     )


# Path: sqlalchemy_continuum/model_builder.py
from copy import copy
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import column_property
from sqlalchemy_utils.functions import get_declarative_base
from .utils import adapt_columns, option
from .version import VersionClassBase
import six
import sqlalchemy as sa

        if not hasattr(self.version_class, 'transaction'):
            self.version_class.transaction = sa.orm.relationship(
                tx_class,
                primaryjoin=tx_class.id == transaction_column,
                foreign_keys=[transaction_column],
            )

    def base_classes(self):
        """
        Returns all base classes for history model.
        """
        return (version_base(self.manager, self.model), )

    def inheritance_args(self, cls, version_table, table):
        """
        Return mapper inheritance args for currently built history model.
        """
        args = {}

        if not sa.inspect(self.model).single:
            parent = find_closest_versioned_parent(
                self.manager, self.model
            )
            if parent:
                # The version classes do not contain foreign keys, hence we
                # need to map inheritance condition manually for classes that
                # use joined table inheritance
                if parent.__table__.name != table.name:
                    mapper = sa.inspect(self.model)


                    inherit_condition = adapt_columns(