Plone dexterity multiselect字段通过模型xml文件

Rap*_* K. 3 plone dexterity

如何通过模型xml文件将多选字段添加到灵巧内容类型?很清楚如何添加单选下拉字段:

<field name="dummy" type="zope.schema.Choice">
...
<source>plone.supermodel.tests.dummy_binder</source>
</field>
Run Code Online (Sandbox Code Playgroud)

但是如何做多选领域呢?基本上与我可以使用此python(zope架构)相同:

my_field = schema.List(
            title="A title",
            value_type=schema.Choice(source='some.source.vocabulary'),
            required=True
            )
Run Code Online (Sandbox Code Playgroud)

我使用python方式没有问题,我只是好奇如何使用xml实现这一点.

谢谢,
Rapolas

Ste*_*veM 5

value_type标记:

<field name="links" type="zope.schema.List">
    <title>Related Items</title>
    <value_type type="zope.schema.Choice">
        <title>Related</title>
        <source>plone.supermodel.tests.dummy_binder</source>
    </value_type>
</field>
Run Code Online (Sandbox Code Playgroud)

您的源应该实现IContextSourceBinder.