feat: add MarketPlace model, migration, and market_url_for helper

Introduces per-page markets (Phase 2):
- MarketPlace model with soft-delete and unique slug index
- NavTop gains market_id FK to scope nav hierarchy per market
- Migration with backfill creates default 'suma-market' for existing market page
- market_url_for() cross-app URL helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-10 18:08:18 +00:00
parent 3cc5730377
commit 7eb66fbf24
6 changed files with 174 additions and 1 deletions

View File

@@ -172,6 +172,14 @@ class Post(Base):
passive_deletes=True,
)
markets: Mapped[List["MarketPlace"]] = relationship(
"MarketPlace",
back_populates="post",
cascade="all, delete-orphan",
passive_deletes=True,
order_by="MarketPlace.name",
)
class Author(Base):
__tablename__ = "authors"