gpt4 book ai didi

plone - 我如何注册一个标记接口(interface)以便它在 Plones 的 ZMI 中可见?

转载 作者:行者123 更新时间:2023-12-01 10:14:02 24 4
gpt4 key购买 nike

我想注册一个标记接口(interface),这样我就可以将它添加到 ZMI 中的对象中。我的产品的 configure.zcml 包含:

<interface interface=".interfaces.IMarkerInterface" />

并且,在重新安装之后,该接口(interface)显示在可用接口(interface)列表中。但是如果我尝试将它添加到 ZMI 中的对象,我会得到一个 ComponentLookupError。缺少什么?

最佳答案

对我来说效果不错。

我在Plone 4.0.3中测试过

用贴纸创建了一个包:

paster create -t​​ plone bogus.interface

使用这个 interfaces.py 文件:

from zope.interface import Interface

class IBogusInterface(Interface):
""" Marker bogus interface
"""

还有这个 configure.zcml 文件:

<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="bogus.interface">

<five:registerPackage package="." initialize=".initialize" />

<!-- -*- extra stuff goes here -*- -->
<interface interface=".interfaces.IBogusInterface" />

</configure>

你确定你没有遗漏任何东西吗?

关于plone - 我如何注册一个标记接口(interface)以便它在 Plones 的 ZMI 中可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2868139/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com