Plone 灵巧度对继承字段重新排序

Plone 灵巧度对继承字段重新排序,plone,dexterity,Plone,Dexterity,如何在我自己编写的字段定义中对继承自现有行为的字段进行重新排序。 例如,我想使用plone.app.contenttypes中的leadimage字段(行为),但我不想将其放在我定义的所有字段的底部,而是希望将其放在描述之后 我试过这样做: <property name="model_source"> &lt;model xmlns:security="http://namespaces.plone.org/supermodel/security"

如何在我自己编写的字段定义中对继承自现有行为的字段进行重新排序。 例如,我想使用plone.app.contenttypes中的leadimage字段(行为),但我不想将其放在我定义的所有字段的底部,而是希望将其放在描述之后

我试过这样做:

<property name="model_source">
    &lt;model xmlns:security="http://namespaces.plone.org/supermodel/security" 
          xmlns:marshal="http://namespaces.plone.org/supermodel/marshal" 
          xmlns:form="http://namespaces.plone.org/supermodel/form" 
          xmlns="http://namespaces.plone.org/supermodel/schema"&gt;
    &lt;schema&gt;
      &lt;field name="image" type="plone.namedfile.field.NamedBlobImage" form:after="description"&gt;
          &lt;title&gt;Image&lt;/title&gt;
      &lt;/field&gt;
    &lt;/schema&gt;
    &lt;/model&gt;
</property>

型号xmlns:security=”http://namespaces.plone.org/supermodel/security" 
xmlns:marshal=”http://namespaces.plone.org/supermodel/marshal" 
xmlns:form=”http://namespaces.plone.org/supermodel/form" 
xmlns=”http://namespaces.plone.org/supermodel/schema"
模式
field name=“image”type=“plone.namedfile.field.NamedBlobImage”表单:after=“description”
标题图像/标题
/场
/模式
/模型

顺便说一句,有没有一种更易读的方法可以做到这一点?

我从未尝试过使用XML,但文档中说这是可能的;检查之后/之前的属性

我认为您可以使用Python代码进行更多的控制;检查文档

form.order_after(image1='ILeadImage.image')
这就成功了,代码示例中有点混乱

跟进问题:
如果我有3个图像字段,每个字段都有一个标题字段,那么我真的必须将该行添加到每个字段本身吗?或者有没有一种方法可以像使用字段集定义一样在一个位置设置所有字段的顺序?

thanx,无论如何,我更喜欢python方法;)