Custom Django signals for update, bulk update/create operations with field tracking
Project description
django-bulk-signals
Custom signal support for Django bulk operations — with granular field-level diffing.
This library extends Django's signal framework to support bulk_create, bulk_update, and queryset update() operations. It also helps detect exactly which fields changed in each object.
✨ Features
pre_bulk_create,post_bulk_createsignalspre_bulk_update,post_bulk_updatesignalspre_updatefor regular.update()calls- Field-level change tracking during bulk operations
- Decorators for easy multi-signal binding
- Drop-in replacement for your model
ManagerorQuerySet
🚀 Installation
pip install django-bulk-signals
🧠 Usage
- Use the custom manager:
from django_bulk_signals.managers import CustomManager
from django.db import models
class Customer(models.Model):
...
objects = CustomManager()
- Connect to signals:
from django.dispatch import receiver
from django_bulk_signals.signals import pre_bulk_update
@receiver(pre_bulk_update, sender=Customer)
def customer_bulk_update_handler(sender, **kwargs):
forward_data = kwargs.get("forward_data")
print("Changed fields:", forward_data)
- Signal Reference
| Signal | Description |
| ------------------ | ---------------------- |
|
pre_update| Before.update()| |pre_bulk_update| Beforebulk_update()| |post_bulk_update| Afterbulk_update()| |pre_bulk_create| Beforebulk_create()| |post_bulk_create| Afterbulk_create()|
🛠️ Tools Decorator
from django_bulk_signals.decorators import apply_signals
@apply_signals(Customer, pre_bulk_update, pre_update)
def handler(sender, **kwargs):
...
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_advanced_bulk_signals-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_advanced_bulk_signals-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63073d2993d2e2de849fad780983742b0aaea58eee617624f9c2795af8ce8ef8
|
|
| MD5 |
b5ee43589b8c778aa1f37a7b0383e585
|
|
| BLAKE2b-256 |
6d3203693a0aed6706e1e9409ff35c4cdf0ce72baf1b4ab8e4171a9203d8328b
|