Add python example for deleting a part (#4703)

* Add python example for deleting a part

* Ignore PRs which are just docs from release notes
This commit is contained in:
Oliver 2023-04-26 23:18:03 +10:00 committed by GitHub
parent 5fcab2aec3
commit 608f96c723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

1
.github/release.yml vendored
View File

@ -4,6 +4,7 @@ changelog:
exclude: exclude:
labels: labels:
- translation - translation
- documentation
categories: categories:
- title: Breaking Changes - title: Breaking Changes
labels: labels:

View File

@ -188,6 +188,18 @@ loc = StockLocation(api, pk=12)
item.transferStock(loc, quantity=50) item.transferStock(loc, quantity=50)
``` ```
### Delete a Part
To delete a [Part instance](../../part/part.md), first in needs to be marked as *inactive* (otherwise it will throw an error):
```python
from inventree.part import Part
part = Part(api, pk=10)
part.save(data={'active': False})
part.delete()
```
### Bulk Delete ### Bulk Delete
Some database models support bulk delete operations, where multiple database entries can be deleted in a single API query. Some database models support bulk delete operations, where multiple database entries can be deleted in a single API query.