我的 FieldRowPanel 错了吗?
padding = FieldRowPanel([
FieldPanel(blocks.ChoiceBlock(
required=False, choices=PADDING_CHOICES, label="Отступ сверху")),
FieldPanel(blocks.ChoiceBlock(
required=False, choices=PADDING_CHOICES, label="Отступ снизу")),
], heading="Отступы")
我正在尝试在这个地方这样做:
class ContentBlockThemed(blocks.StructBlock):
theme = blocks.ChoiceBlock(
required=True, choices=BLOCK_THEMES_CHOICES, label="Тема")
padding = FieldRowPanel([
FieldPanel(blocks.ChoiceBlock(
required=False, choices=PADDING_CHOICES, label="Отступ сверху")),
FieldPanel(blocks.ChoiceBlock(
required=False, choices=PADDING_CHOICES, label="Отступ снизу")),
], heading="Отступы")
visible = blocks.BooleanBlock(required=False, label="Видимый", default=True, help_text="По умолчанию - True")
block_content = ContentBlock()
class Meta:
icon = 'user'
form_classname = 'content-block struct-block pages-content-block'
template = 'wtblocks/content_block.html'
尽管没有错误,但管理员中没有显示任何内容