- 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)
26 lines
665 B
Python
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 = "首页"
|