我需要建立存储夫妇Plone的控制面板配置面板,我想对Plone的3存储字符串对内部plone.app.registry
使用plone.app.registry
如果我限制自己的用户界面,这是相当简单的定义一个模式界面,自动构建这样的:
class IMyPair(Interface):
value = schema.TextLine(title=u"value", required=True)
title = schema.TextLine(title=u"title", required=False)
class MyPair(object):
implements(IMyPair)
def __init__(self, value='', title=''):
self.value = value
self.title = title
class IMyConfigPanel(Interface):
entry = schema.List(
title=_(u'Foo'),
value_type=schema.Object(IMyPair, title=u"entry"),
required=True
)
我们使用这是店内portal_properties夫妇为一个字符串项目(用分隔符)。
使用这种方法(与 “VALUE_TYPE =为schema.object”)与plone.app.registry我得到一个例外,因为IObjectField没有定义IPersistent适配器。
在深入并变得疯狂地提供我自己的适配器之前:有一种更简单的方法来达到我的问题的最初需要?
我也切换到了schema.Dict类型的字段,但是z3c.form现在不支持任何这个小部件。 Bleah! –
很确定collective.z3cform.datagridfield是一个字典,可与plone.app.registry一起使用。 – vangheem