plone - 为什么 CheckBoxFieldWidget 没有工厂?

标签 plone dexterity

将小部件分配给 Dexterity 中的字段的常见方法是这样的

form.widget(hours=DataGridFieldFactory)
hours = schema.List(title=u'Hours',?
                    default=hoursDefault,
                    value_type=DictRow(title=u'Hours', schema=IHours)

Dexterity 文档在这里提到了 CheckBoxFieldWidget:

http://plone.org/products/dexterity/documentation/manual/developer-manual/reference/widgets-1

但是,CheckBoxFieldWidgetFactory 可以以相同的方式使用

form.widget(forProducts=checkbox.CheckBoxFieldWidget)
forProducts = schema.List(title=u'Products',
                          value_type=schema.Choice(source=productsVocabulary))

这里使用 CheckBoxFieldWidget 的正确方法是什么?

最佳答案

CheckBoxFieldWidget CheckBoxWidget 的工厂。您使用上面提供的代码时遇到问题了吗?

关于plone - 为什么 CheckBoxFieldWidget 没有工厂?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13035029/

相关文章:

plone - 设置以编程方式创建的敏捷项目的字段默认值

XSLT/Diazo : create element for each pair of elements

python - 工作副本 checkin 时出现运行时错误(超出最大递归深度)

javascript - 删除 Dexterity 内容类型上的字段集选项卡界面

indexing - plone.indexer 和 Dexterity 的问题

plone - 原型(prototype)和敏捷内容的 portal_catalog 唯一 ID

python - 如何将 onfocus 添加到 z3c.form 输入

adapter - Plone 人 4 : How to customize a method in Archetypes content types?

internationalization - Plone 日期翻译已损坏

plone - 使用 Collective.dexteritytextindexer 扩展 SearchableText