在下面的模型中,我想让bottom_content整个字段不再是必需的。我怎样才能做到这一点?
class ServicePage(Page):
top_content = StreamField(default_blocks + [
('two_columns', TwoColumnBlock()),
('three_columns', ThreeColumnBlock()),
])
bottom_content = StreamField(default_blocks + [
('two_columns', TwoColumnBlock()),
('three_columns', ThreeColumnBlock()),
])
search_fields = Page.search_fields + [
index.SearchField('top_content'),
index.SearchField('bottom_content'),
]
content_panels = Page.content_panels + [
StreamFieldPanel('top_content'),
StreamFieldPanel('bottom_content'),
InlinePanel('service_package', label='Packages')
]
Run Code Online (Sandbox Code Playgroud) 我想让文件上传成为表单页面上可能的 Wagtail 表单字段类型。如何配置模型以使其成为可能?请注意,我对允许用户上传 PDF 之类的文档文件而不是图像更感兴趣。