gpt4 book ai didi

Plone : getting content of an object in python

转载 作者:行者123 更新时间:2023-12-04 05:00:05 25 4
gpt4 key购买 nike

我目前正在尝试为 Plone 开发一个鸡蛋,以将文章的内容发布到 facebook 上。我目前可以获得标题,但找不到访问文章摘要或正文的方法。我查找了都柏林核心标签,但似乎不是正确的方法。

有谁知道如何获取它并将其存储在变量中?

提前致谢。

最佳答案

你的内容对象应该有一个 CookedBody() 方法来渲染正文,以便在 Python 或页面模板中以编程方式使用(例如 <div tal:content="structure context/CookedBody" /> )。

CookedBody() 是 Products.CMFDefault 接口(interface)中定义的方法,据我记事起,随后 Plone 就使用它。 ATContentTypes 为股票 Plone 类型(如 Page/Document 和 News Item)实现了这一点;我不确定 Dexterity 类型是否开箱即用(如果需要,您可能需要在自己的自定义内容类型上实现此方法)。

关于 Plone : getting content of an object in python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16241727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com