将现有数据迁移到 django-cms 插件
我正在从一些独立的应用程序迁移到 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议编写一个处理迁移的 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