2

我有一个 Dexterity Type 的 RelationList 字段Info与另一个 Type 相关Venue

venue = RelationList(
    title=_(u'Venue'),
    value_type=RelationChoice(
        source=ObjPathSourceBinder(
            object_provides=IVenue.__identifier__,
        ),
    ),
    required=False,
)

Venue项目是在特定文件夹 /info 中创建的,如何直接从/info folder而不是从/ folder?

在此处输入图像描述

我的实例现在在 Plone 4.2.4 和 plone.app.dexterity 1.2.1 上运行。

4

1 回答 1

1

To limit the path of the ObjPathSourceBinder one could do the following:

[...]
source=ObjPathSourceBinder(navigtion_tree_query = {
    "object_provides":"IVenue.__identifier__",
    "path": {"query":"/my/path" }
    }
 ),

or you could just add a "path" argument to your code:

[...]
source=ObjPathSourceBinder(
    object_provides,IVenue.__identifier__,
    path={"query":"/mysite/media"},
),

The navigation_tree_query argument ist described here:

于 2013-10-19T13:49:20.880 回答