As an extra thought, I am wondering whether there should be some configuration (either in the settings or on the models themselves) as to whether the __class__.objects..all().delete() is EVER called. It seems super dangerous to me and I'm not sure what it achieves? I would suggest that this code should not be run by default.
For our use case, for example, we would be looking for a couple of options perhaps:
Just don't do anything. Since the parent entity has been soft deleted, these entities can remain in the database without any referential integrity issues. This would work in cases where the OneToOne related fields are only shown in the context of their parent.
Raise an exception. Clearly something has gone awry but instead of deleting everything, we should surface an exception.
I'd be keen to understand (here or on the issue I raised) what the logic behind adding these lines of code was so that a decision can be made on the above.
Fixes #99
As an extra thought, I am wondering whether there should be some configuration (either in the settings or on the models themselves) as to whether the
__class__.objects..all().delete()
is EVER called. It seems super dangerous to me and I'm not sure what it achieves? I would suggest that this code should not be run by default.For our use case, for example, we would be looking for a couple of options perhaps:
I'd be keen to understand (here or on the issue I raised) what the logic behind adding these lines of code was so that a decision can be made on the above.