【发布时间】:2019-07-16 12:14:41
【问题描述】:
我在管理单一视图中为文章页面提供了自定义视图和表单。在表单中,我有 HTML5 选择更改父级(部分)。如何在管理员编辑视图中更改父页面?我尝试使用已编辑的python wagtail.admin.views.pages.edit:
#wagtail code
revision = page.save_revision(
user=request.user,
submitted_for_moderation=is_submitting,
)
#next I try to place my code
new_parent_page_id = request.POST.get('parent_page_id')
if int(new_parent_page_id) != parent.id:
parent = SectionPage.objects.get(id=new_parent_page_id)
page.move(parent, pos='last-child')
page.save()
它不起作用
鹡鸰 2.4 版
【问题讨论】:
标签: django python-3.x wagtail