beda-software / drf-writable-nested

Writable nested model serializer for Django REST Framework
Other
1.07k stars 116 forks source link

Individually Delete Records #103

Closed ehutch79 closed 3 years ago

ehutch79 commented 4 years ago

Given the Meta field 'individual_delete' iterate over records to delete and call the delete method indvidually.

Otherwise retail the default behavior and bulk delete items.

Fixes beda-software/drf-writable-nested#102

codecov-io commented 4 years ago

Codecov Report

Merging #103 into master will decrease coverage by 0.88%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #103      +/-   ##
=========================================
- Coverage   98.59%   97.7%   -0.89%     
=========================================
  Files           3       3              
  Lines         213     218       +5     
=========================================
+ Hits          210     213       +3     
- Misses          3       5       +2
Impacted Files Coverage Δ
drf_writable_nested/mixins.py 97.57% <66.66%> (-0.94%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87a1476...6f584d0. Read the comment docs.

cjnething commented 4 years ago

This is super helpful - can it get merged in? Thanks!

codecov-commenter commented 4 years ago

Codecov Report

Merging #103 into master will decrease coverage by 0.87%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   98.12%   97.24%   -0.88%     
==========================================
  Files           3        3              
  Lines         213      218       +5     
==========================================
+ Hits          209      212       +3     
- Misses          4        6       +2     
Impacted Files Coverage Δ
drf_writable_nested/mixins.py 97.08% <66.66%> (-0.93%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9dfc270...1a4dc0f. Read the comment docs.

ehutch79 commented 3 years ago

Hi!

It's been nearly a year. Is there any comment on this? Why it hasn't been merged or rejected?

ruscoder commented 3 years ago

I like the general solution @kavdev suggested using perform_nested_delete. So, closing for now.