Skip to content
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

Closed
1 of 7 tasks
rithviknishad opened this issue Jun 2, 2023 · 9 comments · May be fixed by #2620
Closed
1 of 7 tasks

Manually cascade delete M2M models when related model is deleted. #1330

rithviknishad opened this issue Jun 2, 2023 · 9 comments · May be fixed by #2620

Comments

@rithviknishad
Copy link
Member

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 from BaseModel.

Expected behavior
ModelAB should be updated to deleted=True when ModelA or ModelB is deleted.

Many to Many models in CARE that are potentially having this issue.

@himanshu-sharmav
Copy link

hi @rithviknishad can I work on this issue?

@github-project-automation github-project-automation bot moved this to Triage in Care Nov 5, 2024
@rithviknishad rithviknishad moved this from Triage to Up Next in Care Nov 5, 2024
@bodhish
Copy link
Member

bodhish commented Nov 10, 2024

@himanshu-sharmav do create a Draft PR and link it

@himanshu-sharmav
Copy link

himanshu-sharmav commented Nov 11, 2024

@bodhish Working on that., can you please specify what is the result which we are sought to get?

@DraKen0009
Copy link
Contributor

@bodhish I'll like to pick it up

@himanshu-sharmav
Copy link

@bodhish I was busy with some other projects , but in the middle of finishing it kindly reassign this to me.

@DraKen0009
Copy link
Contributor

@himanshu-sharmav how about divide things up?
you can take up first 3 -

  • UserDefaultAssetLocation
  • FacilityDefaultAssetLocation
  • ConsultationBed

I can take the bottom 3-

  • FacilityUser
  • InvestigationValue
  • PatientSample

make individual PRs for each model, it will be better and simpler to track and review (also less time consuming)

@himanshu-sharmav
Copy link

@DraKen0009 seems a good idea @bodhish
Please give your advice on this.

@DraKen0009
Copy link
Contributor

@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

@himanshu-sharmav
Copy link

Yes you can I'm currently busy with other stuff.

@vigneshhari vigneshhari closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2025
@github-project-automation github-project-automation bot moved this from Up Next to Done in Care Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
5 participants