2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-10 03:02:19 +00:00

Documentation integration ()

* Add documentation under docs/ directory

* Add CI workflow for mkdocs configuration checking

* Add documentation issue template

* update pip-tools?

* Update .gitignore files

* Fix .gitignore rules

* Improve release notes page

* remove references to old repo
This commit is contained in:
Oliver
2023-04-22 22:40:29 +10:00
committed by GitHub
parent 20f01e8741
commit 2ffd2354eb
487 changed files with 44875 additions and 12 deletions
.github
.gitignore.pre-commit-config.yamlCONTRIBUTING.mdRELEASE.md
docs
.gitignoreLICENSEREADME.md
_includes
ci
docs
api
app
assets
favicon.ico
images
admin
api
app
appgallery
barcode
build
buy
indexgallery
paper_splash.jpg
part
plugin
report
sell
settings
start
stock
logo.pngopen-in-new-custom.svgpaypal-logo-small-min-300x136.png
barcodes
build
buy
credits.mddemo.md
extend
faq.mdfeatures.mdhooks.pyindex.md
javascripts
part
privacy.md
releases
report
sell
settings
start
stock
stylesheets
terminology.md
webfonts
main.pymkdocs.ymlrequirements.txt
readthedocs.yml

@@ -0,0 +1,44 @@
---
title: Bulk Deletion
---
## Bulk Deletion
While deleting items individually via the API is supported, it can prove inefficient (time consuming) when multiple items are to be deleted sequentially.
For example, if the user wishes to delete a large number items (such as lines from a [Bill of Materials](../build/bom.md)), these items are deleted sequentially, with each `DELETE` separate request requiring network transfer, database access, cleanup, etc.
A much more efficient approach is to allow for "bulk deletion" of multiple database items in a single transaction. This means that only one network request is required, and only a single database access request.
So, InvenTree supports a custom "bulk deletion" endpoint which is available for some database models.
## Item Filtering
In a "regular" `DELETE` action, the pk (primary key) of the target object is provided, to designate which object is going to be removed from the database:
`DELETE /api/part/10/`
However this approach does not work if we wish to delete multiple items. To determine which items are to be deleted, additional data can be added to the query (as you would do with a normal `POST` request, for example).
### Primary Key Values
The request can specify a list of individual pk (primary key) values to delete, using the `items` variable:
```json
{
"items": [1, 10, 50, 99]
}
```
### Filters
The request can also specify a list of filters to be applied to the database query. Any items which match the filters will be deleted. Here, use the `filters` variable:
```
{
"filters": {
"active": False,
"category": 7.
}
}
```