{ "info": { "author": "Keryn Knight", "author_email": "django-intercooler_helpers@kerynknight.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "django-intercooler_helpers\n==========================\n\n:author: Keryn Knight\n:version: 0.2.0\n\n.. |travis_stable| image:: https://travis-ci.org/kezabelle/django-intercoolerjs-helpers.svg?branch=0.2.0\n :target: https://travis-ci.org/kezabelle/django-intercoolerjs-helpers\n\n.. |travis_master| image:: https://travis-ci.org/kezabelle/django-intercoolerjs-helpers.svg?branch=master\n :target: https://travis-ci.org/kezabelle/django-intercoolerjs-helpers\n\n============== ======\nRelease Status\n============== ======\nstable (0.2.0) |travis_stable|\nmaster |travis_master|\n============== ======\n\n\n.. contents:: Sections\n :depth: 2\n\nWhat it does\n------------\n\n``intercooler_helpers`` is a small reusable app for `Django`_ which provides a\nfew improvements for working with `Intercooler.js`_.\n\nIt providea a middleware which extracts relevant `Intercooler.js`_ data from the\nquerystring, and attaches it to the request as a separate ``QueryDict`` (ie: it\nbehaves like ``request.POST`` or ``request.GET``)\n\nIt also provides a small middleware for changing request method based on either the\nquery string (``_method=PUT``) or a request header(``X-HTTP-Method-Override: PUT``)\n\nBetween them, they should capture all the incoming `Intercooler.js`_ data on\nwhich the server may act.\n\nInstallation and usage\n----------------------\n\nThis application depends on `django-intercoolerjs`_ which provides a copy of\n`Intercooler.js`_ bundled up for use with the standard `Django`_ staticfiles\napplication.\n\nInstallation\n^^^^^^^^^^^^\n\nYou can grab ``0.2.0`` from `PyPI`_ like so::\n\n pip install django-intercooler-helpers==0.2.0\n\nOr you can grab it from `GitHub`_ like this::\n\n pip install -e git+https://github.com/kezabelle/django-intercooler-helpers.git#egg=django-intercooler-helpers\n\nConfiguration\n^^^^^^^^^^^^^\nYou need to add ``intercooler_helpers.middleware.IntercoolerData`` to your\n``MIDDLEWARE_CLASSES`` (or ``MIDDLEWARE`` on Django **1.10+**).\n\nYou may optionally want to add ``intercooler_helpers.middleware.HttpMethodOverride``\nas well, if you don't already have a method by which to fake the HTTP Method change.\nIf you're using ````\nthen you don't need ``HttpMethodOverride`` at all.\n\nUsage\n^^^^^\n\nA brief overview of the public API provided so far:\n\nIntercoolerData\n***************\n\nFor fully correct detection of `Intercooler.js`_ requests, you can call\n``request.is_intercooler()``.\nBehind the scenes, it uses ``request.maybe_intercooler()`` to\ndetect whether ``ic-request`` was present, indicating it *may* have been a\nvalid `Intercooler.js`_ request, and also checks ``request.is_ajax()``\n\nTo parse the Intercooler-related data out of the query-string, you can use\n``request.intercooler_data`` (not a method!) which is a ``QueryDict`` and should\nbehave exactly like ``request.GET`` - It pulls all of the ``ic-*`` keys out\nof ``request.GET`` and puts them in a separate data structure, leaving\nyour ``request.GET`` cleaned of extraenous data.\n\n``request.intercooler_data`` is a **lazy** data structure, like ``request.user``,\nso will not modify ``request.GET`` until access is attempted.\n\nThe following properties exist, mapping back to the keys mentioned in the\n`Intercooler.js Reference document`_\n\n- ``request.intercooler_data.current_url``\n\n - returns the ``ic-current-url`` or ``None``\n- ``request.intercooler_data.element`` returns a ``namedtuple`` containing\n\n - ``ic-element-name`` or ``None``\n - ``ic-element-id`` or ``None``\n- ``request.intercooler_data.id``\n\n - the ``ic-id`` which made the request. an ever-incrementing integer.\n- ``request.intercooler_data.request``\n\n - a boolean indicating that it was an `Intercooler.js`_ request. Should always\n be true if ``request.is_intercooler()`` said so.\n- ``request.intercooler_data.target_id``\n\n - ``ic-target-id`` or ``None``\n- ``request.intercooler_data.trigger`` returns a ``namedtuple`` containing\n\n - ``ic-trigger-name`` or ``None``\n - ``ic-trigger-id`` or ``None``\n- ``request.intercooler_data.prompt_value``\n\n - If no ``ic-prompt-name`` was given and a prompt was used, this will contain\n the user's response. Appears to be undocumented?\n\n\nHttpMethodOverride\n******************\n\n- ``request.changed_method`` is a boolean indicating that the request was\n toggled from being a ``POST`` to something else (one of\n ``GET``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, ``DELETE``, ``OPTIONS`` ...\n though why you'd want to ``POST`` and have it act as a ``GET`` is beyond me.\n But that's your choice)\n- ``request.original_method`` if either ``_method=X`` or\n ``X-HTTP-Method-Override: X`` caused the request to change method, then this\n will contain the original request. It should always be ``POST``\n- ``request.method`` will reflect the desired HTTP method, rather than the one\n originally used (``POST``)\n\n\nSupported Django versions\n-------------------------\n\nThe tests are run against Django 1.8 through 1.10, and Python 2.7, 3.3, 3.4 and 3.5.\n\nRunning the tests\n^^^^^^^^^^^^^^^^^\n\nIf you have a cloned copy, you can do::\n\n python setup.py test\n\nIf you have tox, you can just do::\n\n tox\n\nRunning the demo\n^^^^^^^^^^^^^^^^\n\nI've not yet built the demo, but eventually you'll be able to do something like\nthe following. It assumes you're using something like `virtualenv`_ and\n`virtualenvwrapper`_ but you can probably figure it out otherwise::\n\n mktmpenv --python=`which python3`\n pip install -e git+https://github.com/kezabelle/django-intercooler-helpers.git#egg=django-intercooler-helpers\n\nThen probably::\n\n cd src/django-intercooler-helpers\n python demo_project.py runserver\n\n\nContributing\n------------\n\nPlease do!\n\nThe project is hosted on `GitHub`_ in the `kezabelle/django-intercooler-helpers`_\nrepository.\n\nBug reports and feature requests can be filed on the repository's `issue tracker`_.\n\nIf something can be discussed in 140 character chunks, there's also `my Twitter account`_.\n\nRoadmap\n-------\n\nTODO.\n\nThe license\n-----------\n\nIt's `FreeBSD`_. There's should be a ``LICENSE`` file in the root of the repository, and in any archives.\n\n.. _FreeBSD: http://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29\n.. _Django: https://www.djangoproject.com/\n.. _Intercooler.js: http://intercoolerjs.org/\n.. _django-intercoolerjs: https://github.com/brejoc/django-intercoolerjs\n.. _GitHub: https://github.com/\n.. _PyPI: https://pypi.python.org/pypi\n.. _Intercooler.js Reference document: http://intercoolerjs.org/reference.html\n.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/en/latest/\n.. _virtualenv: https://virtualenv.pypa.io/en/stable/\n.. _kezabelle/django-intercooler-helpers: https://github.com/kezabelle/django-intercooler-helpers/\n.. _issue tracker: https://github.com/kezabelle/django-intercooler-helpers/issues/\n.. _my Twitter account: https://twitter.com/kezabelle/\n\n\n----\n\nCopyright (c) 2017, Keryn Knight\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n----\n\nChange history for django-intercooler_helpers\n-------------------------------------------------------------\n0.2.0\n^^^^^^\n* Initial release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kezabelle/django-intercoolerjs-helpers", "keywords": "django intercooler intercoolerjs", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-intercooler-helpers", "package_url": "https://pypi.org/project/django-intercooler-helpers/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-intercooler-helpers/", "project_urls": { "Homepage": "https://github.com/kezabelle/django-intercoolerjs-helpers" }, "release_url": "https://pypi.org/project/django-intercooler-helpers/0.2.0/", "requires_dist": [ "Django (>=1.8)", "django-intercoolerjs (>=1.1.0.0)" ], "requires_python": "", "summary": "a small reusable app for Django which provides a few improvements for working with Intercooler.js", "version": "0.2.0" }, "last_serial": 2682249, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "b22b0003574da8588ab394adde78a902", "sha256": "f15d7d182b59faf80df3dd7c6caa4628c6ec502225c14b68252d03c9eae4ad92" }, "downloads": -1, "filename": "django_intercooler_helpers-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b22b0003574da8588ab394adde78a902", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14457, "upload_time": "2017-03-04T13:19:44", "url": "https://files.pythonhosted.org/packages/bf/a0/9d00ae24d1b535fffc5ebcf59ff4ab1d2bf9050100299804e634d4a22e5d/django_intercooler_helpers-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c91a17e6ca3276fe0e5e70bd02695ea", "sha256": "5b0e46be0b4519d2892a8369b2f58ed9412e810516d2a510b0e9e1e5f0bb88d4" }, "downloads": -1, "filename": "django-intercooler_helpers-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2c91a17e6ca3276fe0e5e70bd02695ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17377, "upload_time": "2017-03-04T13:19:47", "url": "https://files.pythonhosted.org/packages/0f/ec/d88768aaf22d2b494b9ea3f9607efe4011cf881677e70c5ad066193f843f/django-intercooler_helpers-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b22b0003574da8588ab394adde78a902", "sha256": "f15d7d182b59faf80df3dd7c6caa4628c6ec502225c14b68252d03c9eae4ad92" }, "downloads": -1, "filename": "django_intercooler_helpers-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b22b0003574da8588ab394adde78a902", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14457, "upload_time": "2017-03-04T13:19:44", "url": "https://files.pythonhosted.org/packages/bf/a0/9d00ae24d1b535fffc5ebcf59ff4ab1d2bf9050100299804e634d4a22e5d/django_intercooler_helpers-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c91a17e6ca3276fe0e5e70bd02695ea", "sha256": "5b0e46be0b4519d2892a8369b2f58ed9412e810516d2a510b0e9e1e5f0bb88d4" }, "downloads": -1, "filename": "django-intercooler_helpers-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2c91a17e6ca3276fe0e5e70bd02695ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17377, "upload_time": "2017-03-04T13:19:47", "url": "https://files.pythonhosted.org/packages/0f/ec/d88768aaf22d2b494b9ea3f9607efe4011cf881677e70c5ad066193f843f/django-intercooler_helpers-0.2.0.tar.gz" } ] }