Flowplayer 和 Dexterity 投掷错误的组合

发布于 2024-12-18 15:54:29 字数 622 浏览 1 评论 0原文

我灵活地定义了一个内容类型,其中包含许多 RichText 字段,并且运行良好。然后我将 Collective.flowplayer 添加到我的安装中。这似乎添加了一个适配器,以便它可以检测内容中是否嵌入了音频或视频播放器 div 标签,这一切都是有意义的。但现在我无法编辑或创建我的其中一种敏捷类型的实例。适配器抛出异常,抱怨类型无法适应 IPrimaryFieldInfo,并且无法保存 dexterity 内容类型。

从另一个 SO 问题中获取线索,我从 plone.directives.form.Schema 和 plone.rfc822.interfaces.IPrimaryFieldInfo 中导出了敏捷性内容类型。这次在 Collective.flowplayer.dexterity 的 update_media_info 函数中出现了一个不同的异常,我可以通过更改来解决该异常:

    if info.value is not None:

    if hasattr(info, 'value') and info.value is not None:

对我来说有点太老套了,无法满意。

这是一个已知问题,还是这只是版本控制的噩梦?

I have defined a content type in dexterity that has a number of RichText fields in it, and this was working fine. I then added collective.flowplayer into my install. This seems to add an adapter so that it can detect if content has an audio or video player div tag embeded in it, which all makes sense. But now I can't edit or create an instance of one of my dexterity types. The adapter throws an exception complaining that the type cannot be adapted to IPrimaryFieldInfo, and the dexterity content type cannot be saved.

Taking the clue from another SO question, I derived the dexterity content type from both plone.directives.form.Schema and plone.rfc822.interfaces.IPrimaryFieldInfo. A different exception this time in collective.flowplayer.dexterity's update_media_info function, which I could work around by changing:

    if info.value is not None:

to

    if hasattr(info, 'value') and info.value is not None:

which is a bit too hacky for me to be happy with.

Is this a known problem, or is this just some versioning nightmare?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文