How do I customize the Wagtail page copy experience?

血红的双手。 提交于 2020-01-04 02:03:47

问题


I have some custom logic (complex unique constraint validation) I would like to check when a user attempts to copy (or move) a certain type of Page in Wagtail. I would also like to give the user an opportunity to change the fields associated with the validation check.

I am aware of the fact that Wagtail exposes a way of customizing the copy (and move) experiences through hooks (http://docs.wagtail.io/en/stable/reference/hooks.html#before-copy-page), but the best I can come up with using that tool is to create a completely new interface and return it in a HttpResponse. Is there a way to merely customize the existing copy (and move) interface for a specific page type?

@hooks.register('before-copy-page')
def before-copy-page(request, page):
    return HttpResponse("New copy interface", content_type="text/plain")

来源:https://stackoverflow.com/questions/55640685/how-do-i-customize-the-wagtail-page-copy-experience

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!