Readonly models in Django admin interface?

前端 未结 14 1530
北恋
北恋 2020-12-02 05:53

How can I make a model completely read-only in the admin interface? It\'s for a kind of log table, where I\'m using the admin features to search, sort, filter etc, but there

14条回答
  •  抹茶落季
    2020-12-02 06:06

    I ran into the same requirement when needing to make all fields readonly for certain users in django admin ended up leveraging on django module "django-admin-view-permission" without rolling my own code. If you need more fine grained control to explicitly define which fields then you would need to extend the module. You can check out the plugin in action here

提交回复
热议问题