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.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

django_bulk_signals-0.4.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file django-bulk-signals-0.4.0.tar.gz.

File metadata

  • Download URL: django-bulk-signals-0.4.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.29.0 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for django-bulk-signals-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1d2dacf43489989212ee5ef70636a3cd53be87c785a23445c27e10e704bc455c
MD5 c498bd20baee4d06f98a619fc8f3859a
BLAKE2b-256 ddd23b7f49f3a2521a732ce3767ee0ec966057a97d4a3921bdd0d37dd1623856

See more details on using hashes here.

Provenance

File details

Details for the file django_bulk_signals-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: django_bulk_signals-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.29.0 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.6.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.11

File hashes

Hashes for django_bulk_signals-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0858273c20fae398eb6c1b8db3311e72c93b4980921a2448edcbbb4c8f906e4
MD5 c1f327246b0a9cd12452a6c03787f653
BLAKE2b-256 86a8200a1f95766ff1efdc91bc476766318ce03e5a5ebf2b62d0749be8f25338

See more details on using hashes here.

Provenance

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