作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下是我正在处理的灵巧内容类型的片段。有两种内容类型,程序和项目。应该可以将项目与程序相关联(我在下面将其定义为 RelationChoice)。
from five import grok
from plone.directives import dexterity, form
from zope import schema
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.interface import invariant, Invalid
from z3c.form import group, field
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.namedfile.field import NamedImage, NamedFile
from plone.namedfile.field import NamedBlobImage, NamedBlobFile
from plone.app.textfield import RichText
from z3c.relationfield.schema import RelationList, RelationChoice
from plone.formwidget.contenttree import ObjPathSourceBinder
from alteroo.programmeshowcase import MessageFactory as _
from alteroo.programmeshowcase.project import IProject
# Interface class; used to define content-type schema.
class IBaseProgramme(form.Schema, IImageScaleTraversable):
"""
Programme
"""
# If you want a schema-defined interface, delete the form.model
# line below and delete the matching file in the models sub-directory.
# If you want a model-based interface, edit
# models/progamme.xml to define the content type
# and add directives here as necessary.
form.model("models/programme.xml")
class IProgamme(IBaseProgramme):
"""A conference program. Programs can contain Sessions.
"""
project = RelationChoice(
title=_(u"Project"),
source=ObjPathSourceBinder(object_provides=IProject.__identifier__),
required=False,
)
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module plone.z3cform.layout, line 66, in __call__
Module plone.z3cform.layout, line 50, in update
Module plone.dexterity.browser.add, line 112, in update
Module plone.z3cform.fieldsets.extensible, line 59, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 141, in update
Module plone.app.z3cform.csrf, line 21, in execute
Module z3c.form.action, line 98, in execute
Module z3c.form.button, line 315, in __call__
Module z3c.form.button, line 170, in __call__
Module plone.dexterity.browser.add, line 99, in handleAdd
Module z3c.form.form, line 247, in createAndAdd
Module plone.dexterity.browser.add, line 78, in add
Module plone.dexterity.utils, line 167, in addContentToContainer
Module OFS.ObjectManager, line 358, in _setObject
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module zope.component.event, line 32, in objectEventNotify
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module five.intid.intid, line 101, in addIntIdSubscriber
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module z3c.relationfield.event, line 39, in addRelationsEventOnly
Module z3c.relationfield.event, line 28, in addRelations
Module z3c.relationfield.event, line 143, in _setRelation
Module zope.component._api, line 169, in getUtility
ComponentLookupError: (<InterfaceClass zc.relation.interfaces.ICatalog>, '')
最佳答案
您需要在插件控制面板中激活“关系字段”(plone.app.relationfield)来安装关系目录。
关于reference - ComponentLookupError : (<InterfaceClass zc. relationship.interfaces.ICatalog>, '' ) 与灵巧引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17619087/
我正在构建一个应用程序,使用collective.lead(主干)查询外部关系数据库中的一些数据。用户可以在自定义 Plone 控制面板工具中修改数据库连接设置(我遵循 Aspeli 的 Profes
我有一个具有多种敏捷类型的自定义产品,setuphandler 使用其中的几种来创建站点结构。这在测试之外没有任何问题,但在测试中它总是失败: Traceback (most recent call
以下是我正在处理的灵巧内容类型的片段。有两种内容类型,程序和项目。应该可以将项目与程序相关联(我在下面将其定义为 RelationChoice)。 from five import grok from
我在为我的产品运行测试时遇到了这个错误,在 Plone 3.3.5 上使用 plone.app.testing 编写: ComponentLookupError: (, '') 但产品在测试之外正常工
我是一名优秀的程序员,十分优秀!