san4ezy / django_softdelete

MIT License
79 stars 21 forks source link

Fix automatic restoration of associated objects #39

Closed milosnikic closed 3 months ago

milosnikic commented 3 months ago

I propose fix for the problem described in this issue. It is important to save an identifier (in this case uuid4) for each soft deletion transaction. That id is propagated to all associated objects and stored when they are soft deleted. When restoration is started, all objects that match that id, will be restored. With this approach, objects that are deleted in another transaction, won't be restored.