from typing import TypeVar, Union from sqlalchemy import Column from sqlalchemy.orm import RelationshipProperty __all__ = [ 'Col', 'Rel', ] # Define type aliases for SQLAlchemy columns and relationships in declarative models _T = TypeVar('_T') Col = Union[Column, _T] Rel = Union[RelationshipProperty, _T]