{ "info": { "author": "Dustin Cotton", "author_email": "dcotton@stormpurple.net", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# A Django app to add Ajax capabilities to django-tables2\n\nThis app is an enhancement for [django-tables2](https://pypi.python.org/pypi/django-tables2). It adds Ajax capability to allow tables to be sorted and paged without reloading the entire page. \n\n- On Pypi [django-ajax-tables](https://pypi.org/project/django-ajax-tables/)\n- On Git [django-ajax-tables](https://github.com/KiwiTrinsic/django-ajax-tables)\n\n## Requirements\n\n- Python 3\n- Django (version 2+)\n- [django-tables2](https://pypi.python.org/pypi/django-tables2)\n- jQuery (for the Ajax calls)\n\n## Installation\n\nInstall with pip:\n\n```python\npip install django-ajax-tables\n```\n\nAdd django_ajax_tables to the settings.py installed_apps:\n\n```python\nINSTALLED_APPS = (\n ...,\n \"django_ajax_tables\",\n)\n```\n\n## Features\n\nThis app adds a new Django template tag {% ajax_table %}. \nThis is a replacement for the django-tables2 {% render_table %} tag.\n\nTo implement the Ajax functionality you will need to add a view which returns the raw table html (example shown below).\nThe {% ajax_table %} tag will use that html to render the table on the page.\nIt will also configure the table sorting and pagination links to perform Ajax calls and in-place updates of the table.\nThis will allow you to sort and page through the table without the entire webpage refreshing on each click.\n\nThis will not affect any LinkColumns that have been added to the table layout.\n\n## Example\n\nCreate a django-tables2 table and wire it to a model as normal:\n\n```python\nimport django_tables2 as tables\n\nclass SimpleTable(tables.Table):\n class Meta:\n model = Simple\n```\n\nCreate a view that exposes the table as raw html:\n\n```python\nfrom django.http import HttpResponse\nfrom django_tables2 import RequestConfig\n\ndef simple_view(request):\n simple_table = SimpleTable(Simple.objects.all())\n RequestConfig(request).configure(simple_table)\n return HttpResponse(simple_table.as_html(request))\n```\nCreate a url mapping for the view:\n\n```\nurlpatterns = [\n ...,\n url(r'^simple_url$', simple_view, name='simple_url_name'),\n```\n\nPlace ajax_table tags where tables are to be displayed:\n\n```\n{% ajax_table \"unique_div_id\" \"simple_url_name\" %}\n```\n\n## Usage\n\nThe ajax_table tag requires at least two parameters.\n\n- The first parameter is a unique id. This id should not used for any other element on the page. The ajax_table tag will create a div element with this id to contain the table.\n- The second parameter is the name of the url that is mapped to the table view.\n- Any additional non-keyword arguments will be passed as positional arguments to the url. If used this will prevent the passing of keyword arguments to the url.\n- The template keyword argument can be used to replace the django-ajax-tables javascript with custom javascript.\n- Any additional keyword arguments will be passed as keyword aguments to the url but only if there were no positional arguments passed to the url.\n\n### Example with positional arguments\n```\n{% ajax_table \"unique_div_id\" \"simple_url_name\" arg1 arg2 %}\n```\n\n### Example with keyword arguments\n```\n{% ajax_table \"unique_div_id\" \"simple_url_name\" filter1=arg1 filter2=arg2 %}\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/KiwiTrinsic/django-ajax-tables", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-ajax-tables", "package_url": "https://pypi.org/project/django-ajax-tables/", "platform": "", "project_url": "https://pypi.org/project/django-ajax-tables/", "project_urls": { "Homepage": "https://github.com/KiwiTrinsic/django-ajax-tables" }, "release_url": "https://pypi.org/project/django-ajax-tables/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Django tag for ajax-enabled tables", "version": "1.0.0" }, "last_serial": 5376086, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "24b082e013f881b054b09cced1bbc396", "sha256": "0cc9c42f1516d62471369cf8d6881176bb9a17eccb0e2ce3915f7f28e6e9c4e9" }, "downloads": -1, "filename": "django_ajax_tables-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "24b082e013f881b054b09cced1bbc396", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4830, "upload_time": "2019-06-08T20:15:14", "url": "https://files.pythonhosted.org/packages/b0/0d/7b5fc58e93ee9bdf01f6a40b2bd244961f7bf20a5cb45ada23b66d422673/django_ajax_tables-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac1ad29ebccc1460ff9951790c336706", "sha256": "6df97b3d04f11868b2105383e99da99c473141f4d1e039d53c257f3685113927" }, "downloads": -1, "filename": "django_ajax_tables-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ac1ad29ebccc1460ff9951790c336706", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4037, "upload_time": "2019-06-08T20:15:16", "url": "https://files.pythonhosted.org/packages/b2/53/54c877def6c90d871dc5eda265ebede4135d7086dcfa81e437bc7dd3534b/django_ajax_tables-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24b082e013f881b054b09cced1bbc396", "sha256": "0cc9c42f1516d62471369cf8d6881176bb9a17eccb0e2ce3915f7f28e6e9c4e9" }, "downloads": -1, "filename": "django_ajax_tables-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "24b082e013f881b054b09cced1bbc396", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4830, "upload_time": "2019-06-08T20:15:14", "url": "https://files.pythonhosted.org/packages/b0/0d/7b5fc58e93ee9bdf01f6a40b2bd244961f7bf20a5cb45ada23b66d422673/django_ajax_tables-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac1ad29ebccc1460ff9951790c336706", "sha256": "6df97b3d04f11868b2105383e99da99c473141f4d1e039d53c257f3685113927" }, "downloads": -1, "filename": "django_ajax_tables-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ac1ad29ebccc1460ff9951790c336706", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4037, "upload_time": "2019-06-08T20:15:16", "url": "https://files.pythonhosted.org/packages/b2/53/54c877def6c90d871dc5eda265ebede4135d7086dcfa81e437bc7dd3534b/django_ajax_tables-1.0.0.tar.gz" } ] }