Files
wagtailcms/apps/home/models.py
T
Zhengen 052fff1a40 feat: add solutions app, fix HomePage subpage_types, add pytest test suite
- apps/solutions: SolutionIndexPage/SolutionPage (mirrors products/cases)
- apps/home: HomePage.subpage_types now includes products/solutions/cases index pages (previously only blog, blocking admin page creation)
- pytest.ini + conftest.py (root_page/home_page fixtures)
- unit tests for core (SEOablePage, FormBlock API repr), products, cases, forms (lead submit API)
2026-08-06 16:23:49 +08:00

26 lines
665 B
Python

from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from apps.core.blocks import COMMON_BLOCKS
from apps.core.models import SEOablePage
class HomePage(SEOablePage):
"""企业官网首页,使用通用组件化 StreamField 拼装页面内容。"""
body = StreamField(COMMON_BLOCKS, use_json_field=True, blank=True)
content_panels = SEOablePage.content_panels + [
FieldPanel("body"),
]
subpage_types = [
"blog.BlogIndexPage",
"products.ProductIndexPage",
"solutions.SolutionIndexPage",
"cases.CaseStudyIndexPage",
]
class Meta:
verbose_name = "首页"