Compare commits

...

1 Commits

Author SHA1 Message Date
giles
e1e6a7a98b Import all app model packages at startup for SQLAlchemy mapper
Cross-domain relationships like Product.order_items → OrderItem use
string references that SQLAlchemy resolves by class name lookup. All
model packages must be imported so every class is registered before
mapper configuration runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:00:32 +00:00

View File

@@ -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