I suppose similar problem would have been discussed here, but I couldn’t find it.
Let’s suppose I have an Editor and a Supervisor. I want the Editor to be able to add new content (eg. a news post) but before publication it has to be acknowledged by Supervisor.
When Editor lists all items, I want to set some fields on the models (like an ‘ack’ field) as read-only (so he could know what had been ack’ed and what’s still waiting approval) but the Supervisor should be able to change everything (list_editable would be perfect)
What are the possible solutions to this problem?
I think there is a more easy way to do that:
Guest we have the same problem of Blog-Post
blog/models.py:
And the magic is in the admin:
blog/admin.py:
In this way you can use the api of custom permission in django, and you can override the methods for save the model or get the queryset if you have to. In the methid
has_approval_permissionyou can define the logic of when the user can or can’t to do something.