django-easy-audit icon indicating copy to clipboard operation
django-easy-audit copied to clipboard

Add custom model for CRUD events

Open anuj-scanova opened this issue 7 months ago • 0 comments

I want to add extra fields to the CRUD event model. My use case is that my application has a feature to invite users who can work on the account owner's data. To do that, I have a middleware that updates request.user with the account owner, in case an invited user is logged in. Also, set request._shared_user to the user who is logged in and acting.

In this case, all events are being logged with the owner user as user instance and, who has performed the event is not being logged.

Could I extend the base CRUD Event table and add a field like shared_user = models.ForeignKey(User) and then update the crud() method to add shared_user = request._shared.user

anuj-scanova avatar Jul 23 '24 11:07 anuj-scanova