{ "info": { "author": "shymonk", "author_email": "hellojohn201@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries" ], "description": "django-datatable\n================\n\n|Build Status| |PyPI|\n\n.. figure:: https://dl.dropboxusercontent.com/u/94696700/example.png\n :alt: preview\n\nOverview\n--------\n\ndjango-datatable is a simple Django app to organize data in tabular\nform based on `datatable `__ and\n`bootstrap `__.\n\nIt is worth mentioning that the design of this project makes reference\nto `django-table2 `__\nand is mainly for the purpose of learning. I really appreciate anyone\nmaking a pull-request to improve it.\n\nRequirements\n------------\n\n- Python 2.x\n\n- jQuery 1.6+\n\n- Django 1.5+\n\n- Bootstrap 3.0\n\nQuick start\n-----------\n\n- Setup Django-datatable application in Python environment:\n\n ::\n\n $ pip install django-datatable\n\n- Define a simple model named Person:\n\n ::\n\n # example/app/models.py\n class Person(models.Model):\n name = models.CharField(max_length=100)\n\n- Add \"table\" to your INSTALLED\\_APPS setting like this:\n\n ::\n\n INSTALLED_APPS = (\n ...,\n 'table',\n )\n\n- Add some data so you have something to display in the table. Now\n define a PersonTable class without any options in the table file.\n\n ::\n\n # example/app/tables.py\n from models import Person\n from table import Table\n from table.columns import Column\n\n class PersonTable(Table):\n id = Column(field='id')\n name = Column(field='name')\n class Meta:\n model = Person\n\nAnd pass a table instance to the view.\n\n::\n\n # example/app/views.py\n from django.shortcuts import render\n from app.tables import PersonTable\n\n def people(request):\n people = PersonTable()\n return render(request, \"index.html\", {'people': people})\n\n- Finally, implement the template:\n\n ::\n\n {# example/templates/index.html}\n {% load static %}\n {% load table_tags %}\n\n \n \n \n\n \n \n \n \n person\n \n \n
\n

people

\n
\n {% render_table people %}\n
\n \n \n\nTag\n---\n\nRender the whole table by simple tag ``{% render_table %}``, pass\n``Table`` instance as single argument.\n\n::\n\n {% render_table table %}\n\nDataSource\n----------\n\nModel\n`````\n\nUses a django MTV model as table data source, and queries all data in\ndatabase by default. See **model** in table options for details.\n\nQuerySet\n````````\n\nSimiliar to **Model**, but pass queryset when you initialize the table\ninstance instead of defining model option. Basically, it is used to\nfilter or sort data you want to display in table.\n\n::\n\n Models:\n\n # models.py\n class Person(models.Model):\n name = models.CharField(max_length=100)\n\n Tables:\n\n # tables.py\n from models import Person\n from table import Table\n from table.columns import Column\n\n class PersonTable(Table):\n id = Column(field='id')\n name = Column(field='name')\n\n Views:\n\n # views.py\n from django.shortcuts import render\n from models import Person\n from app.tables import PersonTable\n\n def people(request):\n people = PersonTable(Person.objects.all())\n return render(request, \"index.html\", {'people': people})\n\nDict-List\n`````````\n\nUse a list of dictionaries as table data source. Fields declared in\ncolumns correspond to the dictionary keys.\n\n::\n\n Tables:\n\n # tables.py\n from table import Table\n from table.columns import Column\n\n class PersonTable(Table):\n id = Column(field='id')\n name = Column(field='name')\n\n Views:\n\n # views.py\n from django.shortcuts import render\n from app.tables import PersonTable\n\n def people(request):\n data = [{'id': 1, 'name': 'John'}, {'id': 2, 'name': 'Tom'}]\n people = PersonTable(data)\n return render(request, \"index.html\", {'people': people})\n\nBuilt-in Ajax\n`````````````\n\nFor large amounts of data, loading them on front-end entirely is\nimpossible. So, django-table provides a simle option 'ajax' to load data\nfrom the server-side asynchronously.\n\nNote that once toggling ``ajax``, the ``model`` option is necessary.\nDjango-table will do paging/searching/sorting based on\n``ModelClass.objects.all()``.\n\n::\n\n Urls:\n\n # urls.py\n urlpatterns = patterns('',\n url(r'^table/', include(table.urls')),\n )\n\n Tables:\n\n # tables.py\n from table import Table\n from table.columns import Column\n\n class PersonTable(Table):\n id = Column(field='id')\n name = Column(field='name')\n\n class Meta:\n model = Person\n ajax = True\n\nCustom Ajax\n```````````\n\nIf you want to customize base data, use ``ajax_source`` option and\nimplement your own Class-based View by subclassing ``FeedDataView``.\n\n::\n\n Tables:\n\n # tables.py\n class PersonTable(Table):\n id = Column(field='id')\n name = Column(field='name')\n\n class Meta:\n model = Person\n ajax = True\n ajax_source = reverse_lazy('table_data')\n\n Urls:\n\n # urls.py\n urlpatterns = patterns('',\n url(r'^table/data/$', MyDataView.as_view(), name='table_data'),\n )\n\n Views:\n\n # views.py\n from table.views import FeedDataView\n from app.tables import PersonTable\n\n class MyDataView(FeedDataView):\n\n token = PersonTable.token\n\n def get_queryset(self):\n return super(MyDataView, self).get_queryset().filter(id__gt=5)\n\nColumns\n-------\n\n- Column\n\n- Link Column\n\n- Datetime Column\n\n- Checkbox Column\n\n- Sequence Column\n\n- Calendar Column\n\nWidgets\n-------\n\n- search-box\n\n- info-label\n\n- pagination\n\n- length-menu\n\n- exten-button(deprecated)\n\nAPI Reference\n-------------\n\n- `wiki `__\n\n.. |Build Status| image:: https://travis-ci.org/shymonk/django-datatable.svg?branch=master\n :target: https://travis-ci.org/shymonk/django-datatable\n.. |PyPI| image:: https://img.shields.io/pypi/v/django-datatable.png\n :target: https://pypi.python.org/pypi/django-datatable", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/shymonk/django-datatable", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-datatable", "package_url": "https://pypi.org/project/django-datatable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-datatable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/shymonk/django-datatable" }, "release_url": "https://pypi.org/project/django-datatable/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "A simple Django app to origanize data in tabular form.", "version": "0.3.1" }, "last_serial": 2869397, "releases": { "0.1.5": [ { "comment_text": "", "digests": { "md5": "dbc2a7e01d1c2a2e0ee3117fd302f868", "sha256": "f1d0a12bf8cdf9bbeff8075876eec9fcf2b7359262ec206e047889938fc22e36" }, "downloads": -1, "filename": "django-datatable-0.1.5.tar.gz", "has_sig": false, "md5_digest": "dbc2a7e01d1c2a2e0ee3117fd302f868", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131916, "upload_time": "2015-12-25T05:18:31", "url": "https://files.pythonhosted.org/packages/f8/48/f24a4660a050e42b8d2af33b2d637b982038b24ccb4dc30793f804e4bb9c/django-datatable-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5d8b803caaeef1ee4788221921f74ad6", "sha256": "2844e2f8d22782ec2c42f885c01194f7a4a8bae90f443adb98404261479b55d5" }, "downloads": -1, "filename": "django-datatable-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5d8b803caaeef1ee4788221921f74ad6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131792, "upload_time": "2016-03-09T03:46:00", "url": "https://files.pythonhosted.org/packages/a2/78/6ab89ce38f95a8fdcac326b11f51ae65654fe155d93db2bc977dbf820baa/django-datatable-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "e3bbf56ecd1943b4949c7e00f2481ab3", "sha256": "9fe2cc202449ec450c81b23ca47c31ea6e7f0b2cdf9efef32e8db3c521cdaa8d" }, "downloads": -1, "filename": "django-datatable-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e3bbf56ecd1943b4949c7e00f2481ab3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132149, "upload_time": "2016-07-18T07:44:50", "url": "https://files.pythonhosted.org/packages/96/a7/399fcd7b27588f874962cd4ecbeab5127ceb52daabafd0110be05cfae57b/django-datatable-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "87bd9b35b107a2fd7c72bfbff4d4276e", "sha256": "0306077ddd3b74c179b8da0b213588dc7c6bfce96c13b07cf9204da9895fb207" }, "downloads": -1, "filename": "django-datatable-0.3.0.tar.gz", "has_sig": false, "md5_digest": "87bd9b35b107a2fd7c72bfbff4d4276e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132108, "upload_time": "2017-05-12T10:12:03", "url": "https://files.pythonhosted.org/packages/8e/e7/6b2a07e7014e6b110c356d72aa3b0889f816c67e916222c69bd5fb1bb91d/django-datatable-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "510c991b5093aede6a88cbd92497eadd", "sha256": "57bc8fc818fa7bd2f8c39b2b48ba2d2d62de18249b508800f18a165409d8e89d" }, "downloads": -1, "filename": "django-datatable-0.3.1.tar.gz", "has_sig": false, "md5_digest": "510c991b5093aede6a88cbd92497eadd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132103, "upload_time": "2017-05-12T13:02:21", "url": "https://files.pythonhosted.org/packages/1a/82/b46ab254dd2b32a791e42de7bc99618344d6ce4ab56dbe17d6c3894c2316/django-datatable-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "510c991b5093aede6a88cbd92497eadd", "sha256": "57bc8fc818fa7bd2f8c39b2b48ba2d2d62de18249b508800f18a165409d8e89d" }, "downloads": -1, "filename": "django-datatable-0.3.1.tar.gz", "has_sig": false, "md5_digest": "510c991b5093aede6a88cbd92497eadd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132103, "upload_time": "2017-05-12T13:02:21", "url": "https://files.pythonhosted.org/packages/1a/82/b46ab254dd2b32a791e42de7bc99618344d6ce4ab56dbe17d6c3894c2316/django-datatable-0.3.1.tar.gz" } ] }