如何以编程方式对 ATFolder 子类的子类重新排序?

发布于 2024-07-08 02:24:18 字数 169 浏览 8 评论 0原文

我有 Plone 产品,它使用自定义文件夹类型来包含一组自定义内容对象。 文件夹类型是通过子类化 BaseFolder 创建的,它有一个包含几个文本字段的架构。 目前,当自定义对象添加到自定义文件夹时,对象会按其 ID 按字母顺序排序。 如何覆盖此行为并允许我的用户手动对自定义文件夹进行排序(例如通过“内容”视图)?

I have Plone product that uses a custom folder type for containing a set of custom content objects. The folder type was created by subclassing BaseFolder and it has a schema with a couple of text fields. Currently, when custom objects are added to the custom folder, the objects are sorted alphabetically by their id. How can I override this behavior and allow my users to sort the custom folders manually, say through the "Contents" view?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-07-15 02:24:18

最快的解决方案:从 ATFolder 而不是 BaseFolder 子类。 这为您提供了所有“正常”重新排序和其他常见的克隆文件夹功能(我怀疑您也想要)。

如果您想更具选择性,请查看 Products/ATContentTypes/content/base.py:ATCTOrderedFolder 和 OrderedBaseFolder。

Quickest solution: subclass from ATFolder instead of BaseFolder. That gives you all the "normal" reordering and other commmon plone folder capabilities (which I suspect you also want).

If you want to be more selective, look into Products/ATContentTypes/content/base.py: ATCTOrderedFolder and OrderedBaseFolder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文