{ "info": { "author": "Martin P. Hellwig", "author_email": "martin.hellwig@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": ".. image:: https://img.shields.io/codeship/a4d04cb0-51e6-0134-0d6b-325cd45b0ee2/default.svg\n :target: https://bitbucket.org/hellwig/django-query-signals\n.. image:: https://coveralls.io/repos/bitbucket/hellwig/django-query-signals/badge.svg?branch=default \n :target: https://coveralls.io/bitbucket/hellwig/django-query-signals?branch=default\n.. image:: https://img.shields.io/pypi/v/django-query-signals.svg\n :target: https://pypi.python.org/pypi/Django-Query-Signals/\n.. image:: https://img.shields.io/badge/Donate-PayPal-blue.svg\n :target: https://paypal.me/MartinHellwig\n.. image:: https://img.shields.io/badge/Donate-Patreon-orange.svg\n :target: https://www.patreon.com/hellwig\n \n\n####################\nDjango Query Signals\n####################\n\nWhat is it?\n===========\nA library that will send signals on queryset data manipulation methods. \n\nWhat problem does it solve?\n===========================\nDjango sends many signals, including when a model instance is created, deleted\nand updated. However when using bulk methods like bulk_create or delete. There\nis no signal send, with this library signals are send on the following methods:\n\n- bulk_create\n- delete \n- get_or_create\n- update_or_create\n- update\n\nA signal will be send before and after the method is executed.\n\nHow do I install it?\n====================\n.. sourcecode:: shell\n\n pip install django-query-signals\n\n\nAdding to Django (using integrator)\n-----------------------------------\n.. sourcecode:: shell\n\n >>> import django_integrator\n >>> django_integrator.add_application('django_query_signals')\n\nIf you don't want to use the above, you can just add 'django_query_signals' to\nyour installed apps.\n\nHow do I use it?\n================\nFrom the namespace django_query_signals you can import the below signals which\nyou can connect to via the usual way.\n\n - pre_bulk_create\n - post_bulk_create,\n - pre_delete\n - post_delete\n - pre_get_or_create\n - post_get_or_create\n - pre_update_or_create\n - post_update_or_create\n - pre_update\n - post_update\n\nFor example:\n\n.. sourcecode:: shell\n\n >>> @receiver(post_bulk_create)\n >>> def callback(signal, sender, args):\n >>> pass\n\nThe argument 'signal' is the signal that is connected, 'sender' is the\nunderlying model class and 'args' is a dictionary which the method in queryset\nis called with, this is supplemented with 'self' which contains the queryset\ninstance and if the connecting signal is a 'post' type the key 'return' is also\nadded which contains the value the method has returned. \n\nIf you connect to the 'pre' type signal, changing the 'args' and 'self' will\nalso change the actual execution of the method.\n\nCaveat\n======\nThis library relies on monkey patching django.db.models.query.QuerySet, thus if\nyour instance also monkey patches the same thing or you use a custom QuerySet in\nyour Manager, then there is a good chance that this library will not work at all\nfor you, however most likely you can work around this issue by examining the\nsignals.py file in this library. \n\nWhat license is this?\n=====================\nTwo-clause BSD\n\n\nHow can I get support?\n======================\nPlease use the repo's bug tracker to leave behind any questions, feedback,\nsuggestions and comments. I will handle them depending on my time and what looks\ninteresting. If you require guaranteed support please contact me via\ne-mail so we can discuss appropriate compensation.\n\n\nSigning Off\n===========\nIs my work helpful or valuable to you? You can repay me by donating via:\n\nhttps://paypal.me/MartinHellwig\n\n.. image:: https://img.shields.io/badge/PayPal-MartinHellwig-blue.svg\n :target: https://paypal.me/MartinHellwig\n :alt: Donate via PayPal.Me\n :scale: 120 %\n\n-or-\n\nhttps://www.patreon.com/hellwig\n\n.. image:: https://img.shields.io/badge/Patreon-hellwig-orange.svg\n :target: https://www.patreon.com/hellwig\n :alt: Donate via Patreon\n :scale: 120 %\n\n\nThank you!", "description_content_type": null, "docs_url": null, "download_url": "https://repository.example.com/django-query-signals/download/0.0.2.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://repository.example.com/django-query-signals/", "keywords": "django,django-integrator", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-query-signals", "package_url": "https://pypi.org/project/django-query-signals/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-query-signals/", "project_urls": { "Download": "https://repository.example.com/django-query-signals/download/0.0.2.zip", "Homepage": "https://repository.example.com/django-query-signals/" }, "release_url": "https://pypi.org/project/django-query-signals/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Django Query Signals", "version": "0.0.2" }, "last_serial": 2339061, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "059f8f6343ec2c5b00d03aae8209191e", "sha256": "46d0d6fdb2af0cc4ad9080eda3510f79b7165a1f47f0d1e77723f12a681712e7" }, "downloads": -1, "filename": "django-query-signals-0.0.1.tar.gz", "has_sig": false, "md5_digest": "059f8f6343ec2c5b00d03aae8209191e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5923, "upload_time": "2016-08-31T20:31:47", "url": "https://files.pythonhosted.org/packages/6c/fc/8a41b2a31fe30d1ec9e8125a1b9f0b9393a223a3546cf7ae800cf3f404e7/django-query-signals-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "532c4c2f04fe4952f1fe74e3fe614e49", "sha256": "7ff90707ac531f684b9e50f758e049175fbdf92cc25e630b285acc50a423bfe1" }, "downloads": -1, "filename": "django-query-signals-0.0.2.tar.gz", "has_sig": false, "md5_digest": "532c4c2f04fe4952f1fe74e3fe614e49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5952, "upload_time": "2016-09-12T22:18:18", "url": "https://files.pythonhosted.org/packages/fc/ed/8a47906b87b05448b8b65acd00cf6bffded01f2d14ed996fd9acac3f63b9/django-query-signals-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "532c4c2f04fe4952f1fe74e3fe614e49", "sha256": "7ff90707ac531f684b9e50f758e049175fbdf92cc25e630b285acc50a423bfe1" }, "downloads": -1, "filename": "django-query-signals-0.0.2.tar.gz", "has_sig": false, "md5_digest": "532c4c2f04fe4952f1fe74e3fe614e49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5952, "upload_time": "2016-09-12T22:18:18", "url": "https://files.pythonhosted.org/packages/fc/ed/8a47906b87b05448b8b65acd00cf6bffded01f2d14ed996fd9acac3f63b9/django-query-signals-0.0.2.tar.gz" } ] }