【发布时间】:2015-10-14 10:35:41
【问题描述】:
我正在尝试将具有 2 种内容类型(原型)的 plone 2.1 插件更新为 Plone 4(敏捷)。
其中一种内容类型 (foo) 的作用类似于 portal_tool,它是一个独特的“容器”,其中必须添加具有某些字段的另一种内容类型 (bar)(并且仅在此“容器”上)。
我不确定是否有办法在 Dexterity 上做到这一点,就像以前在 Archetypes 上一样。此外,在这种情况下,自定义 portal_tools 是 Plone 4.x+ 中可行的方式还是已弃用?
这里有一些摘录(来自 AT):
foo.py:
class foo(UniqueObject, BaseFolder):
...
__implements__ = (getattr(UniqueObject,'__implements__',()),) + (getattr(BaseFolder,'__implements__',()),)
...
allowed_content_types = ['bar']
...
def __init__(self, id=None):
BaseFolder.__init__(self,'portal_foo')
self.setTitle('Foo')
...
bar.py:
class bar(BaseContent):
...
【问题讨论】:
标签: plone