{ "info": { "author": "Nicolas Joyard", "author_email": "joyard.nicolas@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License" ], "description": "django-rql-filter\n=================\n\n|Build Status| |PyPi version| |codecov|\n\nThis app implements a RQL/RSQL/FIQL filter backend for\n`django-rest-framework `__ and\nenables passing arbitrary conditional expressions to filter entities.\n\nInstallation\n------------\n\n.. code:: sh\n\n pip install django-rql-filter\n\nUsage\n-----\n\nAdd ``rql_filter`` to your project ``INSTALLED_APPS``.\n\nAdd the ``RQLFilterBackend`` to your viewset ``filter_backends``:\n\n.. code:: python\n\n from rql_filter.backend import RQLFilterBackend\n\n class ThingyViewSet(viewsets.ReadOnlyModelViewSet):\n filter_backends = (\n ...\n RQLFilterBackend,\n ...\n )\n\nYou may now pass a RQL/RSQL/FIQL query to API URLs using the ``q``\nquerystring parameter:\n\n.. code:: sh\n\n curl http://my.app/api/thingies/?format=json&q=name==bob;age=gt=30\n\nQuery syntax\n------------\n\nA query is made using a combination of field comparisons. Comparisons\nare composed by a field name, an operator and a value.\n\n+-------------------+----------------------------+-----------------------------+\n| Operator | Meaning | Examples |\n+===================+============================+=============================+\n| ``==`` | Equal to | ``name==bob`` |\n+-------------------+----------------------------+-----------------------------+\n| ``!=`` | Not equal to | ``name!=bob`` |\n+-------------------+----------------------------+-----------------------------+\n| ``<`` ``=lt=`` | Less than | ``age<30`` ``age=lt=30`` |\n+-------------------+----------------------------+-----------------------------+\n| ``<=`` ``=le=`` | Less than or equal to | ``age<=30`` ``age=le=30`` |\n+-------------------+----------------------------+-----------------------------+\n| ``>`` ``=gt=`` | Greater than | ``age>30`` ``age=gt=30`` |\n+-------------------+----------------------------+-----------------------------+\n| ``>=`` ``=ge=`` | Greater than or equal to | ``age>=30`` ``age=ge=30`` |\n+-------------------+----------------------------+-----------------------------+\n| ``=in=`` | Belongs to set | ``name=in=(bob,kate)`` |\n+-------------------+----------------------------+-----------------------------+\n| ``=out=`` | Does not belong to set | ``name=out=(bob,kate)`` |\n+-------------------+----------------------------+-----------------------------+\n\nComparisons can traverse model relations by separating field names with\na double underscore: ``father__name==bob``.\n\nValues must be quoted with single or double quotes when they include\nspecial characters or spaces: ``name==\"bob katz\"``.\n\nComparisons may be combined using logical operators: ``;`` for a logical\nAND, and ``,`` for a logical OR: ``name==\"bob\";age>=30``. AND has\npriority over OR; grouping is available using parentheses:\n``name==\"bob\";(age>=30,age<3)``.\n\n**Note:** RQL/RSQL/FIQL support is still incomplete, it will be enhanced\nover time.\n\nConfiguration\n-------------\n\n``RQL_FILTER_QUERY_PARAM`` sets the querystring parameter name to use;\nit defaults to ``'q'``.\n\nUsing without rest-framework\n----------------------------\n\nYou may use the backend manually outside a rest-framework viewset:\n\n.. code:: python\n\n from rql_filter.backend import RQLFilterBackend\n\n # May be reused any number of times\n backend = RQLFilterBackend()\n\n # Fake request object\n class FakeRQLRequest:\n def __init__(self, q):\n self.GET = {'q': q}\n\n qs = Thingy.objects.all()\n filtered_qs = backend.filter_queryset(\n FakeRQLRequest('name==bob;age=gt=30'),\n qs,\n None\n )\n\nTesting\n-------\n\nInstall testing dependencies:\n\n.. code:: sh\n\n pip install -e .[testing]\n\nRun tests:\n\n.. code:: sh\n\n py.test\n\n.. |Build Status| image:: https://travis-ci.org/njoyard/django-rql-filter.svg?branch=master\n :target: https://travis-ci.org/njoyard/django-rql-filter\n.. |PyPi version| image:: https://badge.fury.io/py/django-rql-filter.png\n :target: https://badge.fury.io/py/django-rql-filter\n.. |codecov| image:: https://codecov.io/gh/njoyard/django-rql-filter/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/njoyard/django-rql-filter", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/njoyard/django-rql-filter", "keywords": "django filter drf rest rql rsql fiql", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-rql-filter", "package_url": "https://pypi.org/project/django-rql-filter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-rql-filter/", "project_urls": { "Homepage": "https://github.com/njoyard/django-rql-filter" }, "release_url": "https://pypi.org/project/django-rql-filter/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "A RQL-enabled filter backend for django-rest-framework", "version": "0.1.3" }, "last_serial": 2266545, "releases": { "0.0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "b267ce6566838ad229c0f9066bbd5e40", "sha256": "927e4eaa9c8dd61544bb0e25ee419bf0e926f3ed51c4f1b41d565f960a429954" }, "downloads": -1, "filename": "django-rql-filter-0.1.0.tar.gz", "has_sig": true, "md5_digest": "b267ce6566838ad229c0f9066bbd5e40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2862, "upload_time": "2016-08-05T11:23:48", "url": "https://files.pythonhosted.org/packages/ff/5d/ec9c2e8eed76756727c84e60a5c9e765f2ef1a475afd0b12e0aee048571f/django-rql-filter-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "15616fbdba6c99d9ad5b2561b08d946b", "sha256": "0910d3824871e250075350e39e65eda7c8e39e5e5ae300364527e36ff00af6c0" }, "downloads": -1, "filename": "django-rql-filter-0.1.1.tar.gz", "has_sig": true, "md5_digest": "15616fbdba6c99d9ad5b2561b08d946b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3447, "upload_time": "2016-08-06T08:13:00", "url": "https://files.pythonhosted.org/packages/5c/e9/87f9383b0d89bd70955716664bc54dd63ce783edb5754f7ccba5549cb1cb/django-rql-filter-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3f1165564f531044c69aaeff865e4121", "sha256": "e3a5fc173de015c3720f79d734603a2d4c34fe8cccbf9507602b5fc32531fa2d" }, "downloads": -1, "filename": "django-rql-filter-0.1.2.tar.gz", "has_sig": true, "md5_digest": "3f1165564f531044c69aaeff865e4121", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3454, "upload_time": "2016-08-07T10:25:18", "url": "https://files.pythonhosted.org/packages/11/a4/ad289b459bb868ac94df404be82b583855aea55bcc06196876448d2986b9/django-rql-filter-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2060cb2e86444ed9b1531500d704c6a3", "sha256": "e8d7f6a67066feea6733a51151e92a480aeb7166fbb6ece5167c014c4f9fa688" }, "downloads": -1, "filename": "django-rql-filter-0.1.3.tar.gz", "has_sig": true, "md5_digest": "2060cb2e86444ed9b1531500d704c6a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5400, "upload_time": "2016-08-07T10:50:14", "url": "https://files.pythonhosted.org/packages/b2/aa/f1f6bfbedba0d3e4c9a71e578201d0fa23162fc77d41eb3ab92f9bd86dba/django-rql-filter-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2060cb2e86444ed9b1531500d704c6a3", "sha256": "e8d7f6a67066feea6733a51151e92a480aeb7166fbb6ece5167c014c4f9fa688" }, "downloads": -1, "filename": "django-rql-filter-0.1.3.tar.gz", "has_sig": true, "md5_digest": "2060cb2e86444ed9b1531500d704c6a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5400, "upload_time": "2016-08-07T10:50:14", "url": "https://files.pythonhosted.org/packages/b2/aa/f1f6bfbedba0d3e4c9a71e578201d0fa23162fc77d41eb3ab92f9bd86dba/django-rql-filter-0.1.3.tar.gz" } ] }