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

Adds API mixin for "bulk delete" #3146

Merged

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Jun 6, 2022

  • Introduces a BulkDelete API mixin class
  • Allows deletion of multiple items against a single API request
  • Advantages are atomicity and speed
  • Disadvantages are there are fewer things to debug

Ref: #3143 (comment)

TODO

Refactor (and add unit testing) for the following models which currently implement the inventreeMultiDelete function

  • Stock Item Test Result
  • Attachments
  • BOM items
  • Supplier Parts
  • Manufacturer parts
  • Manufacturer part parameter
  • Stock items
  • Delete outdated inventreeMultiDelete function (JS)

- Allows deletion of multiple items against a single API request
@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature api Relates to the API labels Jun 6, 2022
@SchrodingersGat SchrodingersGat added this to the 0.8.0 milestone Jun 6, 2022
InvenTree/InvenTree/api.py Outdated Show resolved Hide resolved
InvenTree/stock/api.py Outdated Show resolved Hide resolved
@matmair
Copy link
Member

matmair commented Jun 6, 2022

Suggestion (nitpik): I think it would be easier to understand if we just had a single test for multi-delete in InvenTree/InvenTree with one model instead of testing with each view that inherits the mixin.

@SchrodingersGat SchrodingersGat merged commit 00b75d7 into inventree:master Jun 6, 2022
@SchrodingersGat SchrodingersGat deleted the multi-delete-endpoint branch June 6, 2022 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants