将现有数据迁移到 django-cms 插件

发布于 2024-12-21 09:19:34 字数 348 浏览 1 评论 0原文

我正在从一些独立的应用程序迁移到 django-cms,并将为一些更专业的应用程序(例如专辑评论)编写自己的插件。我还没有找到任何关于如何将大量数据导入 django-cms 并使其与插件系统配合良好的文档(我将 10 多年的博客文章添加到 zinnia 中的经验最终导致我告诉 zinnia 使用 django-cms 插件系统,而是充当独立应用程序)。 cms_cmsplugin、cms_placeholder、cms_page_placeholders 有挂钩,我不知道如何通过适当的链接获取现有数据以在页面上显示。

如果我将数据导入到适当的表(例如 zinnia_entry),它在 mysql 中显示正常,但管理页面显示内容字段为空。

I'm migrating from some freestanding apps to django-cms and will be writing my own plugins for some of the more specialized ones (album reviews, for example). I've not found any documentation on how to import a bunch of data into django-cms and have it play nice with the plugin system (my experience with getting 10+ years of blog posts into zinnia ultimately resulted in me telling zinnia to NOT use the django-cms plugin system but to act as a standalone app). There are hooks into cms_cmsplugin, cms_placeholder, cms_page_placeholders, and I can't figure out how to get the existing data in with the appropriate linkages to show on the pages.

If I import the data to the appropriate table (zinnia_entry, for example) it shows up fine in mysql, but the admin pages show the content field to be empty.

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

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

发布评论

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

评论(1

想你的星星会说话 2024-12-28 09:19:34

我建议编写一个处理迁移的 Python 脚本,使用 2.2 中用于 django CMS 内容的新 Python API: https://github.com/divio/django-cms/blob/develop/cms/api.py

I would recommend writing a Python script that handles the migration, using the new Python API for django CMS content in 2.2: https://github.com/divio/django-cms/blob/develop/cms/api.py

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