Filter django admin by logged in user

前端 未结 2 916
小鲜肉
小鲜肉 2020-12-05 22:12

I\'m new to django. I\'m creating simple app in which I have users enter some data and view it later. I need to make django admin show to the user only the data she enter a

2条回答
  •  悲&欢浪女
    2020-12-05 22:47

    You'll have to save in the user to every item and query each item with that user as search criteria. You'll probably build a base model which all your other models will inherit from. To get you started take a look at row-level permissions in the admin.

提交回复
热议问题