Save multiple model instances using one SQL query.
Project description
Django Bulk Saving
About
This package provides utility for saving multiple Django model instances using one SQL query.
Install
pip install django-bulk-saving
Usage
Inherit from BulkSavableModel:
from bulk_saving.models import BulkSavableModel
from django.db import models
class Product(BulkSavableModel):
name = models.CharField(max_length=30)
Use as follows:
with Product.bulk_saving():
for idx, product in enumerate(Product.objects.all(), 1):
product.name = 'Product nr %s' % idx
product.save_later()
Products will be saved after exit from context.
License
The Django Wicked Historian package is licensed under the FreeBSD License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-bulk-saving-1.0.0.tar.gz
.
File metadata
- Download URL: django-bulk-saving-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0db0bf4ac3468416a8740381f0027536659fd09b6798823418b72dfd5204c39 |
|
MD5 | 7bb2fcefa387dfac2dca35cb66c5b046 |
|
BLAKE2b-256 | fee15320c4f1a320d908f97edd42270246e24e5e7284f2dc1790c962034112ed |
File details
Details for the file django_bulk_saving-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_bulk_saving-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1691ba9d7baeef428633b3b67febf1bf82531963cbdeda048424eb5ac707c2d |
|
MD5 | ee636aec5ade91af691b8bb07bc977ce |
|
BLAKE2b-256 | af893bb64fa230f3cf89af4652bfc436327095dca39b15bfb0b5a5fed06adb15 |