Remove the delete button delete_selected from the xadmin list page

xadmin-for-py3 environment

 

In the ModelAdmin class, add the following has_delete_permission method:

 

class ProductAdmin(object):
    list_display = ("code",)
    list_display_links = ("code",)
    search_fields = ["code", "pid"]
    
    def has_delete_permission(self):
        return False

 xadmin.sites.site.register(Product, ProductAdmin)

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326792545&siteId=291194637