{ "info": { "author": "Raphael Cohen", "author_email": "raphael.cohen.utt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "falcon-filtering-hook\n======================\n\n.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n :target: LICENSE\n.. image:: https://travis-ci.org/Darkheir/falcon-filtering-hook.svg?branch=master\n :target: https://travis-ci.org/Darkheir/falcon-filtering-hook\n.. image:: https://codecov.io/gh/Darkheir/falcon-filtering-hook/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Darkheir/falcon-filtering-hook\n.. image:: https://api.codacy.com/project/badge/Grade/151e8f92301d431eb6144cf7915ef897\n :target: https://www.codacy.com/app/Darkheir/falcon-filtering-hook?utm_source=github.com&utm_medium=referral&utm_content=Darkheir/falcon-filtering-hook&utm_campaign=Badge_Grade\n.. image:: https://pyup.io/repos/github/Darkheir/falcon-filtering-hook/shield.svg\n :target: https://pyup.io/repos/github/Darkheir/falcon-filtering-hook/\n :alt: Updates\n\n\nA small falcon hook to parse filtering elements from the request.\n\nUsage\n-----\n\nThe easiest way to use this hook is the following:\n\n.. code:: python\n\n class Resource:\n filtering_fields = (\"foo\", \"bar\") # List of fields allowed for filtering\n\n @falcon.before(FilteringHook())\n def on_get(self, req, resp, user):\n # Here req['context']['filters'] is set\n\nThe Hook will look in the query parameters for parameters looking like :code:`filter[key]=value`.\n\nIt will create a filters dict into the request context accessible at :code:`req.context['filters']`.\nInside this dict the key will be the one extracted from between the brackets.\ni.e. :code:`key` in the example above.\n\nConfiguration options\n---------------------\n\nAllowing fields to be filtered\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nFor security reasons, the fields allowed for filtering must be specified in the :code:`filtering_fields` attribute of the resource.\n\nAll the fields not defined in it will be discarded by the hook.\n\n\nHook configuration\n~~~~~~~~~~~~~~~~~~\n\nOne parameter can be passed to the hook:\n\n* filtering_key : The base name of the key used for the filters. Default: :code:`filter`.\n\nExample:\n\n.. code:: python\n\n @falcon.before(PaginationFromRequestHook(\n filtering_key='custom_filter',\n ))\n def on_get(self, req, resp, user):\n # Get request\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/darkheir/falcon-filtering-hook", "keywords": "falcon filtering filter filters api", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "falcon-filtering", "package_url": "https://pypi.org/project/falcon-filtering/", "platform": "", "project_url": "https://pypi.org/project/falcon-filtering/", "project_urls": { "Homepage": "https://github.com/darkheir/falcon-filtering-hook" }, "release_url": "https://pypi.org/project/falcon-filtering/0.2.0/", "requires_dist": [ "falcon (>=0.3)" ], "requires_python": "", "summary": "Falcon filtering helper", "version": "0.2.0" }, "last_serial": 4795589, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ee40a56a43698de112ca2add89f7fd7f", "sha256": "55e216f4c95f71bcda58541db1c516cd9fe6d6b853cee27e98d26d575314b390" }, "downloads": -1, "filename": "falcon_filtering-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee40a56a43698de112ca2add89f7fd7f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4734, "upload_time": "2019-01-07T21:49:33", "url": "https://files.pythonhosted.org/packages/70/c8/5515b3d57468104a018eb3bc42a94de3648c18358b63528b581a74c3cbcb/falcon_filtering-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b80ddc60e8fea45c44fa1648d1dbf268", "sha256": "70db7f3745a504d493a175c08ed792eb80c8f5c355c365728d011b5a68b63bc8" }, "downloads": -1, "filename": "falcon_filtering-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b80ddc60e8fea45c44fa1648d1dbf268", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2816, "upload_time": "2019-01-07T21:49:35", "url": "https://files.pythonhosted.org/packages/05/1f/5537074769ea75866aa600437f505f9a3862bd0983da739cdfda388dc7dc/falcon_filtering-0.0.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "91d5e069ed5b00469b47d04e35d26245", "sha256": "b7c130ef5b1b6fd883b5ed4148993c8e0cae816aa68a047acd6f6dbb28e89758" }, "downloads": -1, "filename": "falcon_filtering-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "91d5e069ed5b00469b47d04e35d26245", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4149, "upload_time": "2019-02-08T13:51:23", "url": "https://files.pythonhosted.org/packages/65/eb/13cfacc421485de2f00aca0c2e35f8eaa9bddb44b8fd6b1ee81e0c04e49e/falcon_filtering-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df123bfb96380eabf1942b310b296463", "sha256": "1b17e6c345da4a057ce22f5b77db96527133a7b271425f8daf527cc7aa0ec606" }, "downloads": -1, "filename": "falcon_filtering-0.2.0.tar.gz", "has_sig": false, "md5_digest": "df123bfb96380eabf1942b310b296463", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3185, "upload_time": "2019-02-08T13:51:25", "url": "https://files.pythonhosted.org/packages/26/e0/fa9bd83ca338ff80fb56a8f0c1aaca16c8710cf8a434ee4e5d90f9521f6f/falcon_filtering-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "91d5e069ed5b00469b47d04e35d26245", "sha256": "b7c130ef5b1b6fd883b5ed4148993c8e0cae816aa68a047acd6f6dbb28e89758" }, "downloads": -1, "filename": "falcon_filtering-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "91d5e069ed5b00469b47d04e35d26245", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4149, "upload_time": "2019-02-08T13:51:23", "url": "https://files.pythonhosted.org/packages/65/eb/13cfacc421485de2f00aca0c2e35f8eaa9bddb44b8fd6b1ee81e0c04e49e/falcon_filtering-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df123bfb96380eabf1942b310b296463", "sha256": "1b17e6c345da4a057ce22f5b77db96527133a7b271425f8daf527cc7aa0ec606" }, "downloads": -1, "filename": "falcon_filtering-0.2.0.tar.gz", "has_sig": false, "md5_digest": "df123bfb96380eabf1942b310b296463", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3185, "upload_time": "2019-02-08T13:51:25", "url": "https://files.pythonhosted.org/packages/26/e0/fa9bd83ca338ff80fb56a8f0c1aaca16c8710cf8a434ee4e5d90f9521f6f/falcon_filtering-0.2.0.tar.gz" } ] }