When an object is "deleted", its related models which the foreign key to this object is null=True should not be deleted. Instead the related model foreign key should be set to None
Current behavior simply deletes all related on cascade which is not correct.
Proposed Solution:
We should access the Meta fields of each related object and check if the foreign key to the object being deleted can be null or not.
When an object is "deleted", its related models which the foreign key to this object is
null=Trueshould not be deleted. Instead the related model foreign key should be set toNoneCurrent behavior simply deletes all related on cascade which is not correct.
Proposed Solution:
We should access the Meta fields of each related object and check if the foreign key to the object being deleted can be
nullor not.