模型管理中的 wagtai 模型自定义下拉

问题描述

我正在尝试在编辑/创建期间在模型管理中添加自定义下拉操作按钮。

我没有使用 wagtail Page 模型。我使用的是纯 django 模型。

这是我的模型。

class Listing(models.Model):
    title_secondary = models.CharField(
        max_length=100,)
    panels = [
        FieldPanel("title_secondary"),]

我使用 wagtail_hooks.py 文件向 wagtail 管理员注册了这个模型。

class ListingPageModelAdmin(ModelAdmin):
    model = Listing
    menu_label = 'Listing Details'  
    menu_icon = 'doc-full-inverse'
    list_display = ('title_secondary',)
    list_filter = ('title_secondary',)
    search_fields = ('title_secoundary',)
    button_helper_class =  ListingPageButtonHelper

并且我已经在模型的索引页面添加了一些自定义按钮button_helper_class = ListingPageButtonHelper

但我也想在创建/编辑期间添加自定义下拉按钮。请查看屏幕截图,现在只有 savedelete 按钮,我想添加更多按钮。

enter image description here

谁能帮我我该怎么做?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)