{ "info": { "author": "Unleashed NV", "author_email": "operations@unleashed.be", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "[![Coverage Status](https://coveralls.io/repos/github/vikingco/django-triggers/badge.svg)](https://coveralls.io/github/vikingco/django-triggers)\n[![CI Status](https://travis-ci.org/vikingco/django-triggers.svg?branch=master)](https://travis-ci.org/vikingco/django-triggers)\n\nAbout\n-----\n\nDjango Triggers is a light-weight framework for having one part of an\napplication generate a trigger while another part responds to to it.\nTriggers are persistent and can be scheduled to be processed at a later\ntime.\n\nUsage\n-----\n\nTriggers are defined by subclassing the `Trigger` model. `Trigger` defines\ncommon data structures and logic for all child triggers. The only thing a\nchild should have to do is override the `_process` method and set `typed` to\na unique slug.\n\nExamples\n--------\n\nGeneral use\n===========\n\n```python\n\nfrom djtriggers.models import Trigger\n\nclass BreakfastTrigger(Trigger):\n class Meta:\n # There is no trigger specific data so make a proxy model.\n # This ensures no additional db table is created.\n proxy = True\n typed = 'breakfast'\n\n def _process(self, dictionary={}):\n prepare_toast()\n prepare_juice()\n eat()\n\n```\n\nTrigger specific data\n=====================\n\n```python\n\nfrom djtriggers.models import Trigger\n\nclass PayBill(Trigger):\n class Meta:\n # We need a regular model as the trigger specific data needs a\n # place to live in the db.\n proxy = False\n\n amount = models.IntegerField()\n recipient = models.ForeignKey(User)\n\n def _process(self, dictionary={}):\n amount = self.amount\n recipient = self.recipient\n check_balance()\n pay_bill(amount, recipient)\n\n```\n\nTrigger processing\n==================\n\n```python\n\nfrom .models import BreakfastTrigger\nfrom .exceptions import ProcessError\n\ntrigger = BreakfastTrigger.objects.get(pk=1)\ntry:\n trigger.process()\nexcept ProcessError as e:\n report_error(e)\n\n```\n\nDelayed processing\n==================\n\n```python\n\nfrom .models import BreakfastTrigger\n\ntrigger = BreakfastTrigger()\n# Process 8 hours later (this can be any datetime)\ntrigger.process_after = now() + timedelta(hour=8)\n\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vikingco/django-triggers", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-triggers", "package_url": "https://pypi.org/project/django-triggers/", "platform": "", "project_url": "https://pypi.org/project/django-triggers/", "project_urls": { "Homepage": "https://github.com/vikingco/django-triggers" }, "release_url": "https://pypi.org/project/django-triggers/2.0.13/", "requires_dist": [ "Django (<2.3,>=2.1.5)", "celery (>=4.0.0)", "python-dateutil", "django-db-locking (>=2.0.4)" ], "requires_python": "", "summary": "Framework to create and process triggers.", "version": "2.0.13" }, "last_serial": 5164745, "releases": { "2.0.13": [ { "comment_text": "", "digests": { "md5": "adce4666fd5fbb2bea5982c59e4bba78", "sha256": "a9a00c7807f51c21d72680c14f5ee4609cff966815aeed23c9111c9296977249" }, "downloads": -1, "filename": "django_triggers-2.0.13-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "adce4666fd5fbb2bea5982c59e4bba78", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20017, "upload_time": "2019-04-19T13:13:37", "url": "https://files.pythonhosted.org/packages/61/ce/2f5157a6e5aa227d5e93b38a79c43180f2d2de32888ced8b72a0bab91cdb/django_triggers-2.0.13-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4ea8f91382fd0df067f6ff9ecc444f2", "sha256": "9790ea0c9ebbbe8a73fe3c431c456ddf98ad1f7ee95481f87de84483a6d43415" }, "downloads": -1, "filename": "django-triggers-2.0.13.tar.gz", "has_sig": false, "md5_digest": "b4ea8f91382fd0df067f6ff9ecc444f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-04-19T13:13:39", "url": "https://files.pythonhosted.org/packages/16/b6/252fbf5e38fba6a9213b2d964e9e24e67cc24943f40583553377720cd855/django-triggers-2.0.13.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "31381bf30024919cd2cb66399c1c2d66", "sha256": "72fbb685a1c76bb340fe43839faa0c8a2b6543b1d73ad852822aecf0fb1626c4" }, "downloads": -1, "filename": "django_triggers-2.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "31381bf30024919cd2cb66399c1c2d66", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18906, "upload_time": "2017-05-04T14:17:14", "url": "https://files.pythonhosted.org/packages/cb/d2/eb9f78576c228a456cd33d49cfd80de40379f4a3bed5372f942cc57166be/django_triggers-2.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b46f7e123d89296f6aa189a0cf1e958", "sha256": "55aee0a1c0a1c700985d96aa44bc11b3ad7a5a9f567c5e8b4167bc166a3bef41" }, "downloads": -1, "filename": "django-triggers-2.0.3.tar.gz", "has_sig": false, "md5_digest": "5b46f7e123d89296f6aa189a0cf1e958", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10567, "upload_time": "2017-05-04T14:17:04", "url": "https://files.pythonhosted.org/packages/cb/64/542fb9814c8afa3bcc3942ce5ca7790771883c7f331c2efd5418907aed31/django-triggers-2.0.3.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "08a30eafa4affe27ca16676bc688a62f", "sha256": "ba3378670ccca24ad50c36045b27f27908e20bfc31817c53278a7d8d546d0bc6" }, "downloads": -1, "filename": "django_triggers-2.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "08a30eafa4affe27ca16676bc688a62f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19856, "upload_time": "2017-09-25T14:13:25", "url": "https://files.pythonhosted.org/packages/fc/0d/bf49ec4f0463e7a3030357d49940dbac3b4c709b82be8eb4a5ec4c95afda/django_triggers-2.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "adf55059325e72705380fe3a34b3451a", "sha256": "70d6287825384c2a2b9d20e353aa0029f566d7683d23cd5d4f8ce2fb9be0c00d" }, "downloads": -1, "filename": "django_triggers-2.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "adf55059325e72705380fe3a34b3451a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19859, "upload_time": "2017-09-25T14:47:40", "url": "https://files.pythonhosted.org/packages/41/cb/0fa1436944b1ce4ab08c557ffdde6347549883301aa31b5f2308de85139f/django_triggers-2.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a73f0bac5a409d74a0f51820f725e56f", "sha256": "7c2a57e2ebc263fe5e49fbadd2ffd20f51561f1b22651b5bcf4b903d239dc189" }, "downloads": -1, "filename": "django-triggers-2.0.4.tar.gz", "has_sig": false, "md5_digest": "a73f0bac5a409d74a0f51820f725e56f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11034, "upload_time": "2017-09-25T14:13:17", "url": "https://files.pythonhosted.org/packages/3d/8c/dc242f25b30396cb71a4128a2e2a9ca2dfa563d3483877b938e34517f0b5/django-triggers-2.0.4.tar.gz" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "f5d20898741ad72dcb7890be6d3170d1", "sha256": "87cba1eb8f95c02d5b5c225670f15985509addaa3d255257864a1fa1cdc640fe" }, "downloads": -1, "filename": "django_triggers-2.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f5d20898741ad72dcb7890be6d3170d1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19519, "upload_time": "2017-09-27T12:15:13", "url": "https://files.pythonhosted.org/packages/ca/ea/06077855d8b7e94fe26cd852525975889043c659e579a65704bf01cfdc76/django_triggers-2.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eaa296425448d527f4be532842566901", "sha256": "71d9d5ad695b9f57b5c686ce2fd8f1acc99b8cd4804b5e13d766d5bf65df01fe" }, "downloads": -1, "filename": "django-triggers-2.0.5.tar.gz", "has_sig": false, "md5_digest": "eaa296425448d527f4be532842566901", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10973, "upload_time": "2017-09-27T12:15:22", "url": "https://files.pythonhosted.org/packages/f1/df/4f39401597dc9972031786744b5a9577ae60b4ee1317a65d38db636b1888/django-triggers-2.0.5.tar.gz" } ], "2.0.6": [ { "comment_text": "", "digests": { "md5": "45733973194ccb3d039c35450755d675", "sha256": "1d3f7da3ecc6715aab240e1a5f872cb7db972152045ad291200ba5947f9d8043" }, "downloads": -1, "filename": "django_triggers-2.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "45733973194ccb3d039c35450755d675", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20987, "upload_time": "2017-10-04T12:19:45", "url": "https://files.pythonhosted.org/packages/ca/c4/51dfe63d3fcdb3e3967f8f77c9ef087ce57c06e8f1187c10e7c8c98d33f4/django_triggers-2.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a29b20983bbb8bd6dae0d1eb8985807a", "sha256": "e607472f0502152f48fc34fcaa46574b439978a316243f6099706d83efac28f7" }, "downloads": -1, "filename": "django-triggers-2.0.6.tar.gz", "has_sig": false, "md5_digest": "a29b20983bbb8bd6dae0d1eb8985807a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11315, "upload_time": "2017-10-04T12:19:43", "url": "https://files.pythonhosted.org/packages/2f/01/cbfeb5656bff78b4ac40a56704badad99060296acebf80c45dcb35a5af52/django-triggers-2.0.6.tar.gz" } ], "2.0.7": [ { "comment_text": "", "digests": { "md5": "d38ee6e5b8c877cb6e863d5da02d3cce", "sha256": "86c04079e3bc854b8bd86f30a997f6f2649ba793cce0679e96ca0322734816c2" }, "downloads": -1, "filename": "django_triggers-2.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d38ee6e5b8c877cb6e863d5da02d3cce", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20984, "upload_time": "2017-10-04T15:37:28", "url": "https://files.pythonhosted.org/packages/44/bf/174739942b30931b53fa7538dda3941fb591be19bd7dae1fb5e16ecd16d4/django_triggers-2.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a8b7ccc6fb89cc3e5550b296a7e87732", "sha256": "be302c56c6cea262f491407f7bb0f78056783dafbad465a174695083b226dfcf" }, "downloads": -1, "filename": "django-triggers-2.0.7.tar.gz", "has_sig": false, "md5_digest": "a8b7ccc6fb89cc3e5550b296a7e87732", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11326, "upload_time": "2017-10-04T15:37:26", "url": "https://files.pythonhosted.org/packages/82/43/933b0b4fd131eb881dd374a5938bcf46354843178be1333cacbc6b426801/django-triggers-2.0.7.tar.gz" } ], "2.0.8": [ { "comment_text": "", "digests": { "md5": "97d8d1453b56bffb172e821cf76f91f3", "sha256": "735b979a7451475b31b14fc3c5eb036a7bd8190836cd91d8205900fe39577cb2" }, "downloads": -1, "filename": "django_triggers-2.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "97d8d1453b56bffb172e821cf76f91f3", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20980, "upload_time": "2017-10-05T11:08:22", "url": "https://files.pythonhosted.org/packages/0d/68/37a93f7a887d9b0cc278fdbdf569ab43420c1ec48482019892d3062d7dc3/django_triggers-2.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0565970c63618f63fd4271a853d17a7c", "sha256": "ad1727f0f66f71e06247ba4990fc70e9665ca251a69beee9bfcf27e3677086e7" }, "downloads": -1, "filename": "django-triggers-2.0.8.tar.gz", "has_sig": false, "md5_digest": "0565970c63618f63fd4271a853d17a7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11316, "upload_time": "2017-10-05T11:08:21", "url": "https://files.pythonhosted.org/packages/8c/c4/12c43db8955f502bd8a237063dadc15b066fb719a1e43e159b3bcdbba41b/django-triggers-2.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "adce4666fd5fbb2bea5982c59e4bba78", "sha256": "a9a00c7807f51c21d72680c14f5ee4609cff966815aeed23c9111c9296977249" }, "downloads": -1, "filename": "django_triggers-2.0.13-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "adce4666fd5fbb2bea5982c59e4bba78", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20017, "upload_time": "2019-04-19T13:13:37", "url": "https://files.pythonhosted.org/packages/61/ce/2f5157a6e5aa227d5e93b38a79c43180f2d2de32888ced8b72a0bab91cdb/django_triggers-2.0.13-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4ea8f91382fd0df067f6ff9ecc444f2", "sha256": "9790ea0c9ebbbe8a73fe3c431c456ddf98ad1f7ee95481f87de84483a6d43415" }, "downloads": -1, "filename": "django-triggers-2.0.13.tar.gz", "has_sig": false, "md5_digest": "b4ea8f91382fd0df067f6ff9ecc444f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-04-19T13:13:39", "url": "https://files.pythonhosted.org/packages/16/b6/252fbf5e38fba6a9213b2d964e9e24e67cc24943f40583553377720cd855/django-triggers-2.0.13.tar.gz" } ] }