From 0c0f3c84167ff61ad469e1f5ad93de7841c59e76 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 18 Feb 2026 20:46:36 +0000 Subject: [PATCH] Decouple cross-app models: move canonical definitions to shared/models/ - Move 6 model files to shared/models/ (ghost_content, order, page_config, market, market_place, calendars) so apps import from shared, not each other - Fix auth templates: replace url_for('auth.*') with coop_url() for cross-app compatibility - Fix TYPE_CHECKING import in sumup.py to use shared.models.order - Delete dead infrastructure/cart_loader.py (inverted dependency) - Update models/__init__.py to export all new models Co-Authored-By: Claude Opus 4.6 --- browser/app/payments/sumup.py | 2 +- .../templates/_types/auth/_main_panel.html | 2 +- .../_types/auth/_newsletter_toggle.html | 2 +- .../_types/auth/_newsletters_panel.html | 2 +- .../templates/_types/auth/check_email.html | 2 +- browser/templates/_types/auth/login.html | 2 +- infrastructure/cart_loader.py | 11 - models/__init__.py | 16 + models/calendars.py | 296 ++++++++++++ models/ghost_content.py | 216 +++++++++ models/market.py | 441 ++++++++++++++++++ models/market_place.py | 52 +++ models/order.py | 114 +++++ models/page_config.py | 39 ++ 14 files changed, 1180 insertions(+), 17 deletions(-) delete mode 100644 infrastructure/cart_loader.py create mode 100644 models/calendars.py create mode 100644 models/ghost_content.py create mode 100644 models/market.py create mode 100644 models/market_place.py create mode 100644 models/order.py create mode 100644 models/page_config.py diff --git a/browser/app/payments/sumup.py b/browser/app/payments/sumup.py index 50cf2a4..7c15852 100644 --- a/browser/app/payments/sumup.py +++ b/browser/app/payments/sumup.py @@ -9,7 +9,7 @@ from quart import current_app from shared.config import config if TYPE_CHECKING: - from cart.models.order import Order + from shared.models.order import Order SUMUP_BASE_URL = "https://api.sumup.com/v0.1" diff --git a/browser/templates/_types/auth/_main_panel.html b/browser/templates/_types/auth/_main_panel.html index d394dd0..230b07a 100644 --- a/browser/templates/_types/auth/_main_panel.html +++ b/browser/templates/_types/auth/_main_panel.html @@ -18,7 +18,7 @@ {% endif %} {% endif %} -
+