Django Admin- disable Editing and remove “Save” buttons for a specific model

前端 未结 9 1293
眼角桃花
眼角桃花 2020-12-24 07:39

I have a Django Model which I wish to be only readonly. No adds and edits allowed.

I have marked all fields readonly and overridden has_add_permission in ModelAdmin

9条回答
  •  青春惊慌失措
    2020-12-24 08:09

    You could try this package Django Admin View Permission. This package adds a view permission for the specified models and handles the other stuff automatically.

提交回复
热议问题