Skip to main content

Bulk Manager Django

Easier management of the bulk create/update/delete for Django

Bulk Manager is a plugin for Django to facilitate the bulk features of database operations.

Features

  • Easy to use
  • Performance optimization

Advantages

  • Highly flexible
  • Lightweight
  • Open-source
  • Real use cases
  • Support & documentation

Authors

  • Rudy Fernandez

Install

The easiest way to install default_mutable using pip: pip install bulk-manager-django

Methods

Attribute Description
prepareCreate Add the object to the list
create Bulk create all the objects in the create list
set Change an object value
getValueFromMemory Access a specific value from an object if previously set
update Bulk update
prepareDelete Add the object to the list
delete Bulk delete
execute Perform all actions (create, update and delete) at once

prepareCreate

Argument Type Default Description
obj Model or list of Models Model or list of Models to update

create

Argument Type Default Description
listObj list [] List of strings of all Models to create. If empty, create all pending records

set

Argument Type Default Description
obj Model Object to update
attr list or str 'grandfather.father.attr' or ['grandfather', 'father', 'attr']
value Any Value to set

getValueFromMemory

| obj | Model | | Object to get the value from | | attr | str | | Attribute of the object | | default_value | Any | | Default value to return if not in memory | For every value updated with the method 'set' is stored in memory. 'getValueFromMemory' checks if the value has previously been updated.

update

Argument Type Default Description
listObj list [] List of strings of all Models to update. If empty, create all pending records

prepareDelete

Argument Type Default Description
obj Model Record to delete

delete

Argument Type Default Description
listObj list [] List of strings of all Models to delete. If empty, delete all pending records. Deletion occurs in the same order of the list

execute

Argument Type Default Description
create_order list [] List of strings of all Models to delete. If empty, create all pending records. Creation occurs in the same order of the list
delete_order list [] List of strings of all Models to delete. If empty, delete all pending records. Delation occurs in the same order of the list

Examples

from bulk_manager_django.BulkManager import BulkManager
BM = BulkManager()

BM.prepareCreate([
   DemoTable(
      name        = 'built-in create1',
      is_enabled  = True,
      insert_type = 'built-in',
   ),
   DemoTable(
      name        = 'built-in create2',
      is_enabled  = True,
      insert_type = 'built-in',
   ),
   DemoTable(
      name        = 'built-in create3',
      is_enabled  = True,
      insert_type = 'built-in',
   )
])

BM.create() # or BM.execute()

for record in DemoTable.objects.filter(insert_type = 'bulk-manager'):
      BM.set(record, 'description', 'updated description')
      
      BM.set(record, 'platform_name', 'updated platform_name')
      
      BM.set(record, 'is_enabled', randomBool())
      
BM.update() # or BM.execute()

for record in DemoTable.objects.filter(insert_type = 'bulk-manager'):
      BM.prepareDelete(record)
      
   

BM.delete(['DemoTable']) # or BM.delete() or BM.execute() or BM.execute(delete_order= ['DemoTable'])

Metadata

Release files for bulk-manager-django 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bulk-manager-django 0.1.2
File Size Uploaded
bulk_manager_django-0.1.2.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bulk-manager-django 0.1.2
File Interpreter ABI Platform
bulk_manager_django-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / bulk_manager_django-0.1.2.tar.gz

Download URL bulk_manager_django-0.1.2.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dd35955aaf41f3768bc8c98489750beadb5e1d795dbe2430ef8ea6cc99c13356
BLAKE2b-256 checksum
How to use checksums
034e4d6597add437a1f0efd1e108d444308849bd7ce760155004fe3a70172746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.0

Release files / bulk_manager_django-0.1.2-py3-none-any.whl

Download URL bulk_manager_django-0.1.2-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
233f0e3c02fd5edf13f0579384c416aabf66675ba57f18957d93c89b2d1ae799
BLAKE2b-256 checksum
How to use checksums
775c4e93cfce20c11a3f64636d911d485aaab9dc790a69ce3d822627dcf151ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page