{ "info": { "author": "David Jean Louis", "author_email": "izimobil@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "django-rest-framework-datatables\n================================\n\n|build-status-image| |codecov-image| |documentation-status-image| |pypi-version| |py-versions|\n\nOverview\n--------\n\nThis package provides seamless integration between `Django REST framework `_ and `Datatables `_.\n\nInstall django-rest-framework-datatables, call your API with ``?format=datatables`` and it will return a JSON structure that is fully compatible with what Datatables expects.\nIt handles searching, filtering, ordering and most usecases you can imagine with Datatables.\n\nThe great benefit of django-rest-framework-datatables is that you don't have to create a different API, your API still work exactly the same unless you specify the ``datatables`` format on your request.\n\nFull documentation is available on `Read the Docs `_ !\n\nRequirements\n------------\n\n- Python (2.7, 3.4, 3.5, 3.6)\n- Django (1.9, 1.10, 1.11, 2.0, 2.1)\n- Django REST Framework (3.5, 3.6, 3.7, 3.8, 3.9)\n\nQuickstart\n----------\n\nInstallation\n~~~~~~~~~~~~\n\nJust use ``pip``:\n\n.. code:: bash\n\n $ pip install djangorestframework-datatables\n\nConfiguration\n~~~~~~~~~~~~~\n\nTo enable Datatables support in your project, add ``'rest_framework_datatables'`` to your ``INSTALLED_APPS``, and modify your ``REST_FRAMEWORK`` settings like this:\n\n.. code:: python\n\n REST_FRAMEWORK = {\n 'DEFAULT_RENDERER_CLASSES': (\n 'rest_framework.renderers.JSONRenderer',\n 'rest_framework.renderers.BrowsableAPIRenderer',\n 'rest_framework_datatables.renderers.DatatablesRenderer',\n ),\n 'DEFAULT_FILTER_BACKENDS': (\n 'rest_framework_datatables.filters.DatatablesFilterBackend',\n ),\n 'DEFAULT_PAGINATION_CLASS': 'rest_framework_datatables.pagination.DatatablesPageNumberPagination',\n 'PAGE_SIZE': 50,\n }\n\nAnd that's it !\n~~~~~~~~~~~~~~~\n\nYour API is now fully compatible with Datatables and will provide searching, filtering, ordering and pagination without any modification of your API code !\n\nAlways Serialize Specific Fields\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nSometimes you may want to expose fields regardless of datatable's url parameters. You can do so by setting the ``datatables_always_serialize`` tuple like so:\n\n.. code:: python\n\n class ArtistSerializer(serializers.ModelSerializer):\n id = serializers.IntegerField(read_only=True)\n \n class Meta:\n model = Artist\n fields = (\n 'id', 'name',\n )\n datatables_always_serialize = ('id',)\n\nAn example of Datatable\n~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: html\n\n \n \n \n \n Rolling Stone Top 500 albums of all time\n \n \n \n \n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n
RankArtistAlbum nameYearGenres
\n
\n
\n
\n \n \n \n \n \n \n\nExample project\n---------------\n\nTo play with the example project, just clone the repository and run the dev server.\n\n.. code:: bash\n\n $ git clone https://github.com/izimobil/django-rest-framework-datatables.git\n $ cd django-rest-framework-datatables\n $ pip install -r requirements-dev.txt\n $ python example/manage.py runserver\n $ firefox http://127.0.0.1:8000\n\nTesting\n-------\n\nInstall development requirements.\n\n.. code:: bash\n\n $ pip install -r requirements-dev.txt\n\nRun the tests.\n\n.. code:: bash\n\n $ python example/manage.py test\n\nYou can also use the excellent `tox`_ testing tool to run the tests\nagainst all supported versions of Python and Django. Install tox\nglobally, and then simply run:\n\n.. code:: bash\n\n $ tox\n\nIf you want to check the coverage, use:\n\n.. code:: bash\n\n $ coverage run ./example/manage.py test\n $ coverage report -m\n\nDocumentation\n-------------\n\nThe documentation is available online on `Read the Docs `_.\n\nTo build the documentation, you\u2019ll need to install ``sphinx``.\n\n.. code:: bash\n\n $ pip install -r requirements-docs.txt\n\nTo build the documentation:\n\n.. code:: bash\n\n $ cd docs\n $ make clean && make build\n\n\n.. _tox: http://tox.readthedocs.org/en/latest/\n\n.. |build-status-image| image:: https://secure.travis-ci.org/izimobil/django-rest-framework-datatables.svg?branch=master\n :target: http://travis-ci.org/izimobil/django-rest-framework-datatables?branch=master\n :alt: Travis build\n\n.. |codecov-image| image:: https://codecov.io/gh/izimobil/django-rest-framework-datatables/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/izimobil/django-rest-framework-datatables\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/djangorestframework-datatables.svg\n :target: https://pypi.python.org/pypi/djangorestframework-datatables\n :alt: Pypi version\n\n.. |documentation-status-image| image:: https://readthedocs.org/projects/django-rest-framework-datatables/badge/?version=latest\n :target: http://django-rest-framework-datatables.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. |py-versions| image:: https://img.shields.io/pypi/pyversions/djangorestframework-datatables.svg\n :target: https://img.shields.io/pypi/pyversions/djangorestframework-datatables.svg\n :alt: Python versions\n\n.. |dj-versions| image:: https://img.shields.io/pypi/djversions/djangorestframework-datatables.svg\n :target: https://img.shields.io/pypi/djversions/djangorestframework-datatables.svg\n :alt: Django versions\n\n\nChangelog\n=========\n\nVersion 0.5.0 (2019-03-31):\n---------------------------\n\n- Fixed total number of rows when view is using multiple filter back-ends\n- New meta option ``datatables_extra_json`` on view for adding key/value pairs to rendered JSON\n- Minor docs fixes\n\nVersion 0.4.1 (2018-11-16):\n---------------------------\n\n- Added support for Django 2.1 and DRF 3.9\n- Updated README\n\nVersion 0.4.0 (2018-06-22):\n---------------------------\n\n- Added top level filtering for nested serializers\n- Added multiple field filtering\n- Added a ?keep= parameter that allows to bypass the filtering of unused fields\n- Better detection of the requested format\n- Fixed typo in Queryset.count() method name\n\n\nVersion 0.3.0 (2018-05-11):\n---------------------------\n\n- Added a serializer Meta option ``datatables_always_serialize`` that allows to specify a tuple of fields that should always be serialized in the response, regardless of what fields are requested in the Datatables request\n- Optimize filters\n- Use AND operator for column filtering instead of OR, to be consistant with the client-side behavior of Datatables\n\nVersion 0.2.1 (2018-04-11):\n---------------------------\n\n- This version replaces the 0.2.0 who was broken (bad setup.py)\n\nVersion 0.2.0 (2018-04-11):\n---------------------------\n\n- Added full documentation\n- Removed serializers, they are no longer necessary, filtering of columns is made by the renderer\n\nVersion 0.1.0 (2018-04-10):\n---------------------------\n\nInitial release.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/izimobil/django-rest-framework-datatables", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "djangorestframework-datatables", "package_url": "https://pypi.org/project/djangorestframework-datatables/", "platform": "", "project_url": "https://pypi.org/project/djangorestframework-datatables/", "project_urls": { "Homepage": "https://github.com/izimobil/django-rest-framework-datatables" }, "release_url": "https://pypi.org/project/djangorestframework-datatables/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Seamless integration between Django REST framework and Datatables (https://datatables.net)", "version": "0.5.0" }, "last_serial": 5009663, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d3b2b060cdb7768803e87ae75033592d", "sha256": "bde0a0491fc8690958f6ebf9ec893354deec71f3c6c22807518d25974a19bb2a" }, "downloads": -1, "filename": "djangorestframework_datatables-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d3b2b060cdb7768803e87ae75033592d", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5395, "upload_time": "2018-04-10T10:46:55", "url": "https://files.pythonhosted.org/packages/0e/06/e51cf35171e930812c3097e2f46470e706c3292e6557f79395e0896d8687/djangorestframework_datatables-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "62335936021fbc13c5bded2e1a2a31b2", "sha256": "0a7e86e559bd4cd82de9b3ef1499bf8d87df0f53ffb3997f430b1a68701b1243" }, "downloads": -1, "filename": "djangorestframework-datatables-0.1.0.tar.gz", "has_sig": false, "md5_digest": "62335936021fbc13c5bded2e1a2a31b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6758, "upload_time": "2018-04-10T10:46:54", "url": "https://files.pythonhosted.org/packages/9c/19/bc21c73922599088fdc28ca812c6c3223045746a148d3a2ab2cfc2956c76/djangorestframework-datatables-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "84b02dabfcdbc9600fbd0df4168fc971", "sha256": "2e6d5c48b4900ec1c642b07713c6e1fc10db000f830f18aa0a6352a3b0205390" }, "downloads": -1, "filename": "djangorestframework_datatables-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "84b02dabfcdbc9600fbd0df4168fc971", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7054, "upload_time": "2018-04-11T14:54:56", "url": "https://files.pythonhosted.org/packages/b2/7b/be10fe829ca70a1879ee09e108ea242565a4d08162b4635bfae7a912253f/djangorestframework_datatables-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b24b908627e2bd68a552fe81b583ae16", "sha256": "bfb34f526d78a33b487d8d1cce180cafea75d754efc60dc977be715a08ac588d" }, "downloads": -1, "filename": "djangorestframework-datatables-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b24b908627e2bd68a552fe81b583ae16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7902, "upload_time": "2018-04-11T14:54:55", "url": "https://files.pythonhosted.org/packages/5f/c3/99b191b64ee102060d745dbf728e9c94e24491819bc3a7509cd1d7d78b6c/djangorestframework-datatables-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "2cb2192b4e7e065f37b7fca887567d48", "sha256": "3273cca6b5687afaada286c0dd06cd674221d68fe1e2a50a37f926b12cfd10fa" }, "downloads": -1, "filename": "djangorestframework_datatables-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2cb2192b4e7e065f37b7fca887567d48", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7090, "upload_time": "2018-04-11T15:16:48", "url": "https://files.pythonhosted.org/packages/3f/8d/9782b3d1411d17a530d21d8eeb5ac6b4d78de9db9bb7a4934801ea1d3a4d/djangorestframework_datatables-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfa7cbca6426236802e386e650d28acc", "sha256": "eca988e4db6e0846bf63bf4f38f0b5603a06d91e3bf178a2f3b560ada324ba3e" }, "downloads": -1, "filename": "djangorestframework-datatables-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cfa7cbca6426236802e386e650d28acc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7965, "upload_time": "2018-04-11T15:16:46", "url": "https://files.pythonhosted.org/packages/88/80/e3275377a815bafa4a35f496f76a2cea365e32d9a3e4f7bb26a3e1d6cc74/djangorestframework-datatables-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "b19a95be789b2ed349979ed7e8049017", "sha256": "657d6e8d93fd711cb873b37295bcdedbbb332d3cc43ebd78919512a01525ecaf" }, "downloads": -1, "filename": "djangorestframework_datatables-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b19a95be789b2ed349979ed7e8049017", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7548, "upload_time": "2018-05-11T08:26:25", "url": "https://files.pythonhosted.org/packages/f2/61/1ad24129c41d4f8b65365de636e21859cdfbfa087dff6896ba59333beee6/djangorestframework_datatables-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "99fa1293c14e3ed91d35552f8c3f8891", "sha256": "a1888f4a9c141dc4f63210a461dd5ec0089299986358c179aaf927dc2e802d23" }, "downloads": -1, "filename": "djangorestframework-datatables-0.3.0.tar.gz", "has_sig": false, "md5_digest": "99fa1293c14e3ed91d35552f8c3f8891", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8483, "upload_time": "2018-05-11T08:26:23", "url": "https://files.pythonhosted.org/packages/56/a2/5d846d2349d2f6b9770b47d405d4c0a55e995bd04ef6c499791a0719901a/djangorestframework-datatables-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "cdd3e4ce29b65a01842f8eb0e24dcbbc", "sha256": "aedaf6a6f2fe4dacf9e5f0321a958fde2a806e68cf3816e97196ae935442aad8" }, "downloads": -1, "filename": "djangorestframework_datatables-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cdd3e4ce29b65a01842f8eb0e24dcbbc", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8159, "upload_time": "2018-06-22T08:04:47", "url": "https://files.pythonhosted.org/packages/06/e5/a019ad0fbad826bcead88a1e699872df0176fc76d6c57447b3e1de0a3733/djangorestframework_datatables-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a289f0c60282a4a5dbca559de00dc312", "sha256": "d0c1270ac71193ddd90b66d5d7eb68737e0b9d9d8fcce2d9498be2263f9a62e6" }, "downloads": -1, "filename": "djangorestframework-datatables-0.4.0.tar.gz", "has_sig": false, "md5_digest": "a289f0c60282a4a5dbca559de00dc312", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9037, "upload_time": "2018-06-22T08:04:44", "url": "https://files.pythonhosted.org/packages/1d/d3/31b422d2aa2e1a63b675849b9e0bc4fc2771f81c28072a8d19df71575466/djangorestframework-datatables-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "02562e3e1d0a6141059cf278c79c555b", "sha256": "cccd8eb82fc4b398e7c0419a4c08b13ddbabc09f3f2604be397de469f9059e5e" }, "downloads": -1, "filename": "djangorestframework_datatables-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "02562e3e1d0a6141059cf278c79c555b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8392, "upload_time": "2018-11-16T13:06:31", "url": "https://files.pythonhosted.org/packages/51/d2/61a40f68df03da8aff5a36105800a7ee34c33ebd698abbd0ddfe191a8e8c/djangorestframework_datatables-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfa8ad9773aec58783569aea13a37d98", "sha256": "a8c0671fb5390e70962fcabac7099f3f9140a84dee1b1eb9acbce800a42407f3" }, "downloads": -1, "filename": "djangorestframework-datatables-0.4.1.tar.gz", "has_sig": false, "md5_digest": "cfa8ad9773aec58783569aea13a37d98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9374, "upload_time": "2018-11-16T13:06:28", "url": "https://files.pythonhosted.org/packages/0a/b1/6440f8709d51544edd9aa5f777b8f0b5ec0d40f5b4eb6eb70788504aeef1/djangorestframework-datatables-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "8b68a5d2a2b3ef4a31e25abe5bbae956", "sha256": "dba764874070d4760aeb9144b33de3b7c63b9c3787731d062d3a7cf2ca82923e" }, "downloads": -1, "filename": "djangorestframework_datatables-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b68a5d2a2b3ef4a31e25abe5bbae956", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8764, "upload_time": "2019-03-31T15:02:27", "url": "https://files.pythonhosted.org/packages/7f/3d/515911b8975bcc47ce52bf0c60185adc0b2ed828dee660273de8390bea4d/djangorestframework_datatables-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca28dbdab501397f5e3440d438cfde06", "sha256": "93a2e7be645b556753f818bf98d74e2eda598e9cf120bfc63abb2fd41ac7eda7" }, "downloads": -1, "filename": "djangorestframework-datatables-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ca28dbdab501397f5e3440d438cfde06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9727, "upload_time": "2019-03-31T15:02:25", "url": "https://files.pythonhosted.org/packages/e8/ea/7deea01846451d712301cfb85c7950c91ae7c5450a60a572e7ea0599215c/djangorestframework-datatables-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b68a5d2a2b3ef4a31e25abe5bbae956", "sha256": "dba764874070d4760aeb9144b33de3b7c63b9c3787731d062d3a7cf2ca82923e" }, "downloads": -1, "filename": "djangorestframework_datatables-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b68a5d2a2b3ef4a31e25abe5bbae956", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8764, "upload_time": "2019-03-31T15:02:27", "url": "https://files.pythonhosted.org/packages/7f/3d/515911b8975bcc47ce52bf0c60185adc0b2ed828dee660273de8390bea4d/djangorestframework_datatables-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca28dbdab501397f5e3440d438cfde06", "sha256": "93a2e7be645b556753f818bf98d74e2eda598e9cf120bfc63abb2fd41ac7eda7" }, "downloads": -1, "filename": "djangorestframework-datatables-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ca28dbdab501397f5e3440d438cfde06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9727, "upload_time": "2019-03-31T15:02:25", "url": "https://files.pythonhosted.org/packages/e8/ea/7deea01846451d712301cfb85c7950c91ae7c5450a60a572e7ea0599215c/djangorestframework-datatables-0.5.0.tar.gz" } ] }