Skip to main content

A product aggregation function to a postgres database and makes it available with django

Project description

GitHub version PyPI version

Testing CodeFactor codecov

Summary

This django library adds signals for the bulk database actions provided by django (bulk_create, bulk_update and QuerySet.update)

usage

Add app to settings

INSTALLED_APPS = [
    ...,
    bulk_signals,
    ...
]

Import signals and connect.The signals are connected the same way as in Django itself. To see them in action use the following snippet:

from django.dispatch import receiver
from bulk_signals import signals

@receiver(signals.pre_bulk_update, signals.post_bulk_update, signals.post_query_update)
def debug(*args, **kwargs):
    print(args)
    print(kwargs)

You can skip the signals on a single execution by using the skip_signal=True keyword argument. Which keyword should be used for skipping is configurable via the BULK_SIGNALS_SKIP_KEY="skip_signal" configuration in the django settings.

TODO

  • test against different database backends

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-bulk-signals-0.4.2.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

django_bulk_signals-0.4.2-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page