我根据Plone Dexterity界定了一些内容类型,我希望任何内容类型都有自己的身份证。 因此,我使用了zope.schema。 同上。
class IArticle(form.Schema, IImageScaleTraversable):
"""
Article
"""
form.model("models/article.xml")
id = schema.Id(
title=_(u"Identifier"),
description=_(u"The unique identifier of object."),
required=False
)
当我制造新的物品时,该物品会作罚款,但当我想修改一个存在的条款时,它总是显示我的错误:
{ args : (<MultiContentTreeWidget form.widgets.IRelatedItems.relatedItems >,),
context : <Article at /dev/articles/this-is-another-articles>,
default : <object object at 0x100266b20>,
loop : {},
nothing : None,
options : {},
repeat : {},
request : <HTTPRequest, URL=http://localhost:8083/dev/articles/this-is-another-article/@@edit>,
template : <zope.browserpage.viewpagetemplatefile.ViewPageTemplateFile object at 0x10588ecd0>,
view : <MultiContentTreeWidget form.widgets.IRelatedItems.relatedItems >,
views : <zope.browserpage.viewpagetemplatefile.ViewMapper object at 0x10b309f50>}
.......
.......
.......
Module zope.tales.expressions, line 217, in __call__
Module zope.tales.expressions, line 211, in _eval
Module plone.formwidget.contenttree.widget, line 147, in render_tree
Module plone.app.layout.navigation.navtree, line 186, in buildFolderTree
Module Products.CMFPlone.CatalogTool, line 427, in searchResults
Module Products.ZCatalog.ZCatalog, line 604, in searchResults
Module Products.ZCatalog.Catalog, line 907, in searchResults
Module Products.ZCatalog.Catalog, line 656, in search
Module Products.ZCatalog.Catalog, line 676, in sortResults
Module plone.app.folder.nogopip, line 104, in documentToKeyMap
Module plone.folder.ordered, line 102, in getObjectPosition
Module plone.folder.default, line 130, in getObjectPosition
ValueError: No object with id "this-is-another-articles" exists.