-
Notifications
You must be signed in to change notification settings - Fork 331
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
Manually cascade delete M2M models when related model is deleted. #1330
Comments
hi @rithviknishad can I work on this issue? |
@himanshu-sharmav do create a Draft PR and link it |
@bodhish Working on that., can you please specify what is the result which we are sought to get? |
@bodhish I'll like to pick it up |
@bodhish I was busy with some other projects , but in the middle of finishing it kindly reassign this to me. |
@himanshu-sharmav how about divide things up?
I can take the bottom 3-
make individual PRs for each model, it will be better and simpler to track and review (also less time consuming) |
@DraKen0009 seems a good idea @bodhish |
@himanshu-sharmav are you still working on it? I'm done with my parts, if you aren't getting time then I can finish up for you as well |
Yes you can I'm currently busy with other stuff. |
Describe the bug
Currently, most M2M models are not deleted when their related model is deleted. The
on_delete
doesn't take effect as we use soft delete for all the models that inherits fromBaseModel
.Expected behavior
ModelAB
should be updated todeleted=True
whenModelA
orModelB
is deleted.Many to Many models in CARE that are potentially having this issue.
UserDefaultAssetLocation
FacilityDefaultAssetLocation
AssetBed
Soft delete AssetBed records whose asset or bed is deleted and manually cascade delete it too #1322ConsultationBed
FacilityUser
InvestigationValue
PatientSample
The text was updated successfully, but these errors were encountered: