Plone ';位置错误';在使用自定义导入器导入某些基于敏捷性的内容类型后,在“自定义”字段上

Plone ';位置错误';在使用自定义导入器导入某些基于敏捷性的内容类型后,在“自定义”字段上,plone,dexterity,Plone,Dexterity,我已经为自定义灵巧内容类型创建了一个导入器。它可以很好地导入类型,但是当我尝试查看新导入的内容时,我得到了“LocationError”,我得到了以下回溯: Traceback (innermost last): Module ZPublisher.Publish, line 60, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_o

我已经为自定义灵巧内容类型创建了一个导入器。它可以很好地导入类型,但是当我尝试查看新导入的内容时,我得到了“LocationError”,我得到了以下回溯:

Traceback (innermost last):
  Module ZPublisher.Publish, line 60, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module grokcore.view.components, line 140, in __call__
  Module grokcore.view.components, line 144, in _render_template
  Module five.grok.components, line 130, in render
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 946, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /home/action/workspace/zeocluster/src/collective.nonprofitprogrammes/collective/nonprofitprogrammes/programme_templates/programmeview.pt
   - Line 20, Column 8
   - Expression: <PathExpr standard:u'context/background/output'>
   - Names:
      {'args': (),
       'container': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'context': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'default': <object object at 0x7f60dda304e0>,
       'here': <Programme at /Plone2/my-content/dry-forest-conservation-programme>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7f60cc0673c0>,
       'request': <HTTPRequest, URL=http://mybox-23772.use1.actionbox.io:8080/Plone2/my-content/dry-forest-conservation-programme/programmeview>,
       'root': <Application at >,
       'static': <Products.Five.metaclass.DirectoryResource12 object at 0x7f60cc073ed0>,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x8ee7550>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <collective.nonprofitprogrammes.programme.ProgrammeView object at 0x7f60cc073bd0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f60cc073c10>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: (u'Jam...ation.\n', 'output', [])
LocationError: (u'Jam...ation.\n', 'output')
回溯(最里面的最后一个):
发布中的模块ZPublisher.Publish,第60行
模块ZPublisher.mapply,第77行,在mapply中
模块ZPublisher.Publish,第46行,在call_对象中
模块grokcore.view.components,第140行,输入调用__
模块grokcore.view.components,第144行,在_render_模板中
模块5.grok.components,第130行,在渲染中
模块zope.pagetemplate.pagetemplate,第132行,在pt_渲染中
模块zope.pagetemplate.pagetemplate,第240行,在调用中__
模块zope.tal.t interpreter,第271行,输入调用__
模块zope.tal.t解释程序第343行
do_useMacro中的模块zope.tal.tInterpreter,第888行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_defineSlot中模块zope.tal.tInterpreter,第954行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.tInterpreter,第858行,在do_defineMacro中
模块zope.tal.t解释程序第343行
do_defineSlot中模块zope.tal.tInterpreter,第954行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_defineSlot中模块zope.tal.tInterpreter,第954行
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.t Interpreter,第946行,在do_defineSlot中
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.tInterpreter,第858行,在do_defineMacro中
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_insertStructure_tal中模块zope.tal.tInterpreter,第742行
evaluateStructure中模块Products.PageTemplates.Expressions,第218行
模块zope.tales.tales,第696行,在评估中
-URL:/home/action/workspace/zeocluster/src/collective.nonprofitprogrammes/collective/nonprofitprogrammes/program_templates/programmeview.pt
-第20行第8栏
-表达方式:
-姓名:
{'args':(),
“容器”:,
“上下文”:,
“默认值”:,
“这里”:,
'循环':{},
“没有”:没有,
“选项”:{},
“重复”:,
“请求”:,
“根”:,
“静态”:,
“模板”:,
“遍历子路径”:[],
“用户”:,
“视图”:,
“视图”:
模块zope.tales.expressions,第217行,输入调用__
模块Products.PageTemplates.Expressions,第147行,评估中
模块zope.tales.expressions,第124行,评估
模块Products.PageTemplates.Expressions,第97行,在trustedBoboAwareZopeTraverse中
模块zope.traversing.adapters,第136行,在TraversePath中
-_uuu回溯_uu信息:(u'Jam…ation.\n','output',[])
位置错误:(u'Jam…ation.\n','output')
有趣的是,访问内容类型的url,后跟/edit works,保存更改后视图工作。

LocationError消息的“输出”部分表明它在呈现RichText字段时遇到问题。是否可能使用RichTextValue以外的内容初始化RichText字段

不能只将字符串分配给RichText字段。它需要一个RichTextValue:

from plone.app.textfield.value import RichTextValue
context.body = RichTextValue(u"Your text here, in HTML")
有关详细信息,请参阅。它允许您设置输入和输出mime类型以及文本。

LocationError消息的“输出”部分表明它在呈现RichText字段时遇到问题。是否可能使用RichTextValue以外的内容初始化RichText字段

不能只将字符串分配给RichText字段。它需要一个RichTextValue:

from plone.app.textfield.value import RichTextValue
context.body = RichTextValue(u"Your text here, in HTML")

有关详细信息,请参阅。它允许您设置输入和输出mime类型以及文本。

您可以共享programmerview.pt模板相关位吗?下面的RichTextValue解决方案是否有帮助?如果没有,我们需要更多的线索来帮助解决这个问题。你能分享你的programmerview.pt模板的相关信息吗?下面的RichTextValue解决方案是否有帮助?如果没有,我们需要更多的线索来帮助解决这个问题。谢谢史蒂文,这就是解决方案。谢谢史蒂文,这就是解决方案。