-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on_delete=models.SET_NULL is not working as expected #161
Comments
The You need to overwrite the If you want to actually delete it (and trigger the on_delete), you have to hard delete it: |
I’m using this policy: _safedelete_policy = SOFT_DELETE_CASCADE I have two models A and B with safe delete, the first one being a foreign key of the second one, when I delete an object in A the foreign key in B is set to null apparently. Is it a normal behavoir? because when I undelete the object in A I just can’t find the object in B anymore... |
B may be still deleted. There was a recent contribution which also undelete (#197) which also undelete linked objects. It is not released yet so you can try it with the master version. |
Actually I just released it in 1.2.0, you can test it with this version 😉 . |
awesome thanks |
I added a row in Asset and which is referenced in Claim. Then I delete that asset, but the asset reference in the Claim model is not set to null and it is still referencing the safe deleted asset.
Is there any other configuration required to make this work..?
The text was updated successfully, but these errors were encountered: