Disable link to edit object in django's admin (display list only)?

后端 未结 12 563
渐次进展
渐次进展 2020-12-12 22:05

In Django\'s admin, I want disable the links provided on the \"select item to change\" page so that users cannot go anywhere to edit the item. (I am going to limit

12条回答
  •  生来不讨喜
    2020-12-12 22:50

    with django 1.6.2 you can do like this:

    class MyAdmin(admin.ModelAdmin):
    
        def get_list_display_links(self, request, list_display):
            return []
    

    it will hide all auto generated links.

提交回复
热议问题