Add a restriction in standard Django Adminke
There's a laser adminke, they're entitled to add and edit materials. However, when a laser with these rights enters the materials, he will see all the materials there, both his and his.
How do we make every laser see only his materials he added? So you could edit, too, only yours.
The table has a field. user_id(Foreign Keys - User)I mean, every material knows who made it.
You need to look towards the method.
class MyModelAdmin(admin.ModelAdmin): def queryset(self, request): qs = super(MyModelAdmin, self).queryset(request) if request.user.is_superuser: return qs return qs.filter(author=request.user)