{
"info": {
"author": "Omni Digital",
"author_email": "dev@omni-digital.co.uk",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Framework :: Django",
"Framework :: Django :: 1.10",
"Framework :: Django :: 1.8",
"Framework :: Django :: 1.9",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "django-conditioner\n==================\n\n|Build status| |PyPI version| |Python versions| |License|\n\nCreate simple 'if this then that' style rules in your Django\napplication. Comes with a bunch of ready-to-use actions and conditions,\nbut is also easily extensible and allows model specific\nactions/conditions.\n\nConditioner helps you create simple rules that consist of a condition\n(if this), and an action (then that). It's currently a work in progress,\nbut we successfully use it in production with custom conditions and\nactions that allow us to send 'reminder' emails to users before their\nlicense expires.\n\nIt was created to 'scratch an itch', and for the foreseeable future we\nwill prioritise implementing use-cases needed by us as. The overall\ngoal, however, is to create a set of useful actions and conditions that\ncould be applied to a number of different scenarios.\n\nOh, and shout-out to\n`django-polymorphic `__\nwithout which this whole thing would be much harder to do.\n\nInstallation\n------------\n\n>From PyPI:\n\n.. code:: shell\n\n $ pip install django-conditioner\n\nUsage\n-----\n\nIf you want to use the already implemented actions and conditions then\nall you need to do is install the package, add ``conditioner`` to your\nlist of ``INSTALLED_APPS`` and run ``$ python manage.py migrate``.\n\nYou should then see a ``Conditioner`` section with a ``Rule`` child in\nDjango Admin. Adding a new one should be pretty self-explanatory.\n\nAdvanced usage\n--------------\n\nActions and conditions types\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n| Both actions and conditions are divided into generic, model generic\n and model specific types:\n| - generic actions/conditions don't need a set target type (i.e. log a\n message on every Monday) - model generic actions/conditions need a set\n target type, but work with all available models (i.e. log a message\n when selected target type instance was created) - model specific\n actions/conditions are implemented with specific model in mind and\n area available only when it's selected (i.e. send email to user on\n every Monday); they usually operate on specific fields (``user.email``\n in previous example)\n\nAdding new actions and/or conditions\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nOne of the main goals was to make conditioner as flexible as possible\nand make adding new actions/conditions as easy as possible.\n\nCreating the action\n^^^^^^^^^^^^^^^^^^^\n\nAll actions need to inherit from ``BaseAction`` and implement\n``run_action()``. Model generic actions should set ``model_specific`` to\n``True``, model specific actions should set it to return the needed\nmodel class. If your action is model specific then model instance will\nbe passed to ``run_action()`` method as ``instance`` named argument.\n\nMaking sure that the action is picked up by Django\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nYou'll need to make sure that your newly created action is picked up by\nDjango. Assuming that it lives in an ``actions.py`` file inside\n``sample_module`` module, your ``sample_module/apps.py`` should look\nsomething like this:\n\n.. code:: python\n\n from django.apps import AppConfig\n\n\n class SampleModuleAppConfig(AppConfig):\n name = 'sample_module'\n\n def ready(self):\n # Make sure that all models are imported\n from sample_module import actions # noqa\n\nRegistering action to Django Admin\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFinally you'll need to hook up your action to the ``Rule`` Django Admin.\nYou do that by adding it to the list of available inline polymorphic\nmodels:\n\n.. code:: python\n\n from polymorphic.admin import StackedPolymorphicInline\n\n from conditioner.admin import ActionInline\n from sample_module.actions import SampleModuleAction\n\n\n # Register `SampleModuleAction` action to 'conditioner' Django Admin\n class SampleModuleActionInline(StackedPolymorphicInline.Child):\n model = SampleModuleAction\n\n\n ActionInline.child_inlines.append(SampleModuleActionInline)\n\nAssuming you put the code above in the ``sample_module/conditioner.py``\nfile, you'll need to make sure that it's also picked up by Django by\nadding ``from sample_module import conditioner`` to your app config\n``ready()`` method.\n\nYou should now see your custom action in Django Admin.\n\nAPI\n---\n\nThere's no proper documentation as of now, but the code is commented and\n*should* be pretty straightforward to use.\n\nThat said - feel free to open a `GitHub\nissue `__\nif anything is unclear.\n\nTests\n-----\n\nPackage was tested with the help of ``tox`` on Python 3.4, 3.5 and 3.6\nwith Django 1.8, 1.9 and 1.10 (see ``tox.ini``).\n\nTo run tests yourself you need to run ``tox`` inside the repository:\n\n.. code:: shell\n\n $ tox\n\nContributions\n-------------\n\nPackage source code is available at\n`GitHub `__.\n\nFeel free to use, ask, fork, star, report bugs, fix them, suggest\nenhancements, add functionality and point out any mistakes. Thanks!\n\nNew actions and conditions more then welcome but should be first\ndiscussed and agreed upon.\n\nAuthors\n-------\n\nDeveloped and maintained by `Omni\nDigital `__.\n\nReleased under `MIT\nLicense `__.\n\n.. |Build status| image:: https://img.shields.io/travis/omni-digital/django-conditioner.svg\n :target: https://travis-ci.org/omni-digital/django-conditioner\n.. |PyPI version| image:: https://img.shields.io/pypi/v/django-conditioner.svg\n :target: https://pypi.python.org/pypi/django-conditioner\n.. |Python versions| image:: https://img.shields.io/pypi/pyversions/django-conditioner.svg\n :target: https://pypi.python.org/pypi/django-conditioner\n.. |License| image:: https://img.shields.io/github/license/omni-digital/django-conditioner.svg\n :target: https://github.com/omni-digital/django-conditioner/blob/master/LICENSE\n\n\n",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/omni-digital/django-conditioner/releases/latest",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/omni-digital/django-conditioner",
"keywords": "django conditions ifttt",
"license": "MIT License",
"maintainer": "",
"maintainer_email": "",
"name": "django-conditioner",
"package_url": "https://pypi.org/project/django-conditioner/",
"platform": "",
"project_url": "https://pypi.org/project/django-conditioner/",
"project_urls": {
"Download": "https://github.com/omni-digital/django-conditioner/releases/latest",
"Homepage": "https://github.com/omni-digital/django-conditioner"
},
"release_url": "https://pypi.org/project/django-conditioner/0.1.0/",
"requires_dist": [
"django-polymorphic (>=1.1)"
],
"requires_python": "",
"summary": "Create simple 'if this then that' style rules in your Django application. Comes with a bunch of ready to use actions and conditions, but is also easily extensible and allows model specific actions/conditions.",
"version": "0.1.0"
},
"last_serial": 2712016,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "ab44ba6a24e610a2ce74599171805c53",
"sha256": "b0a6b4488e42365cbf37fe12d4afe163b47d0784849614df7839eb25ec569162"
},
"downloads": -1,
"filename": "django_conditioner-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab44ba6a24e610a2ce74599171805c53",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 30192,
"upload_time": "2017-03-17T08:37:43",
"url": "https://files.pythonhosted.org/packages/83/bf/8ec1db773006bb45153a7f9f2f555c8da03a155659fb3449d296bfc8e3a6/django_conditioner-0.1.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "a0276649f78e91e30fb31cda6096187a",
"sha256": "c6401a4cc7fae5dd5d2825cbcb75b53976215a6da27e21f9a14b5f75dcb6bbf9"
},
"downloads": -1,
"filename": "django-conditioner-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a0276649f78e91e30fb31cda6096187a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18575,
"upload_time": "2017-03-17T08:37:45",
"url": "https://files.pythonhosted.org/packages/4d/09/c95ec2ecf967078cbb8e6b725e421f5169cf92661132de93d2d69a9897ad/django-conditioner-0.1.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "ab44ba6a24e610a2ce74599171805c53",
"sha256": "b0a6b4488e42365cbf37fe12d4afe163b47d0784849614df7839eb25ec569162"
},
"downloads": -1,
"filename": "django_conditioner-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab44ba6a24e610a2ce74599171805c53",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 30192,
"upload_time": "2017-03-17T08:37:43",
"url": "https://files.pythonhosted.org/packages/83/bf/8ec1db773006bb45153a7f9f2f555c8da03a155659fb3449d296bfc8e3a6/django_conditioner-0.1.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "a0276649f78e91e30fb31cda6096187a",
"sha256": "c6401a4cc7fae5dd5d2825cbcb75b53976215a6da27e21f9a14b5f75dcb6bbf9"
},
"downloads": -1,
"filename": "django-conditioner-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "a0276649f78e91e30fb31cda6096187a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18575,
"upload_time": "2017-03-17T08:37:45",
"url": "https://files.pythonhosted.org/packages/4d/09/c95ec2ecf967078cbb8e6b725e421f5169cf92661132de93d2d69a9897ad/django-conditioner-0.1.0.tar.gz"
}
]
}