diff --git a/infrastructure/factory.py b/infrastructure/factory.py index c79845f..a1814eb 100644 --- a/infrastructure/factory.py +++ b/infrastructure/factory.py @@ -8,7 +8,14 @@ from typing import Callable, Awaitable, Sequence from quart import Quart, request, g, send_from_directory from shared.config import init_config, config, pretty -from shared.models import KV # ensure models imported +from shared.models import KV # ensure shared models imported +# Register all app model classes with SQLAlchemy so cross-domain +# relationship() string references resolve correctly. +for _mod in ("blog.models", "market.models", "cart.models", "events.models"): + try: + __import__(_mod) + except ImportError: + pass from shared.log_config import configure_logging from shared.events import EventProcessor