Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
默认情况下,wagtailStreamField在管理员中的空字段看起来像这样,显示用户可用的不同块:
StreamField
但是,我希望它默认包含我选择的块。例如:
我将如何做到这一点?为该字段设置default关键字参数似乎不起作用。
default
当您尝试设置默认关键字时,您是否将其设置在 StreamField 内的 RichTextBlock 上?根据文档,所有块类型都接受以下可选关键字参数:默认、标签、组、图标和模板。例如:
body = StreamField([ ('paragraph', blocks.RichTextBlock(default='Add you content here')), ])