{ "info": { "author": "Tom", "author_email": "tom@tomforb.es", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Flask", "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===============================================\ndatatables |PyPi Version| |TravisCI| |Coverage|\n===============================================\n\n.. |PyPi Version| image:: http://img.shields.io/pypi/v/datatables.svg?style=flat\n :target: https://pypi.python.org/pypi/datatables\n\n.. |TravisCI| image:: https://api.travis-ci.org/orf/datatables.svg\n :target: https://travis-ci.org/orf/datatables\n\n.. |Coverage| image:: https://coveralls.io/repos/orf/datatables/badge.png?branch=master\n :target: https://coveralls.io/r/orf/datatables?branch=master\n\n\n\n\nInstallation\n------------\n\nThe package is available on `PyPI `_ and is tested on Python 2.7 to 3.4\n\n.. code-block:: bash\n\n pip install datatables\n\nUsage\n-----\n\nUsing Datatables is simple. Construct a DataTable instance by passing it your request parameters (or another dict-like\nobject), your model class, a base query and a set of columns. The columns list can contain simple strings which are\ncolumn names, or tuples containing (datatable_name, model_name), (datatable_name, model_name, filter_function) or\n(datatable_name, filter_function).\n\nAdditional data such as hyperlinks can be added via DataTable.add_data, which accepts a callable that is called for\neach instance. Check out the usage example below for more info.\n\n\nExample\n-------\n\n**models.py**\n\n.. code-block:: python\n\n class User(Base):\n __tablename__ = 'users'\n\n id = Column(Integer, primary_key=True)\n full_name = Column(Text)\n created_at = Column(DateTime, default=datetime.datetime.utcnow)\n\n # Use lazy=joined to prevent O(N) queries\n address = relationship(\"Address\", uselist=False, backref=\"user\", lazy=\"joined\")\n\n class Address(Base):\n __tablename__ = 'addresses'\n\n id = Column(Integer, primary_key=True)\n description = Column(Text, unique=True)\n user_id = Column(Integer, ForeignKey('users.id'))\n\n**views.py**\n\n.. code-block:: python\n\n @view_config(route_name=\"data\", request_method=\"GET\", renderer=\"json\")\n def users_data(request):\n # User.query = session.query(User)\n table = DataTable(request.GET, User, User.query, [\n \"id\",\n (\"name\", \"full_name\", lambda i: \"User: {}\".format(i.full_name)),\n (\"address\", \"address.description\"),\n ])\n table.add_data(link=lambda o: request.route_url(\"view_user\", id=o.id))\n table.searchable(lambda queryset, user_input: perform_some_search(queryset, user_input))\n\n return table.json()\n\n**template.jinja2**\n\n.. code-block:: html\n\n \n \n \n \n \n \n \n \n \n \n
IdUser nameAddress
\n\n ", "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/orf/datatables/", "keywords": "sqlalchemy datatables jquery pyramid flask", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "datatables", "package_url": "https://pypi.org/project/datatables/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/datatables/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/orf/datatables/" }, "release_url": "https://pypi.org/project/datatables/0.4.9/", "requires_dist": null, "requires_python": null, "summary": "Integrates SQLAlchemy with DataTables (framework agnostic)", "version": "0.4.9" }, "last_serial": 1372661, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2eb54b16a1c5ab813449db7352526f73", "sha256": "e119331b98329228a8677cf6b6137feab1384288e8b199beef143e6e6d8ae5c3" }, "downloads": -1, "filename": "datatables-0.1.zip", "has_sig": false, "md5_digest": "2eb54b16a1c5ab813449db7352526f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1968, "upload_time": "2014-08-08T09:00:22", "url": "https://files.pythonhosted.org/packages/7a/44/1efa7b5152a709b3d74a5445046488ddd549c25cf259474ec284138ce778/datatables-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e0b33601430e37d6e59bc16838d61d0b", "sha256": "4853890de70bcdeed3ebd2ca4e8faaadd808f9e294c9d6ff98eb4460f096f358" }, "downloads": -1, "filename": "datatables-0.2.zip", "has_sig": false, "md5_digest": "e0b33601430e37d6e59bc16838d61d0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7414, "upload_time": "2014-08-11T09:13:28", "url": "https://files.pythonhosted.org/packages/4a/b6/393327c472684f8e8ec689dfc78ebabcdfe8ee157d806be9fc9f0627a83a/datatables-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "8105a69bdc9ca2b8b0778caeaaf9fd2e", "sha256": "c804230b92f82fece8628a545a1b27ec3ebd6352e7d8e34026d0c9e92d0bb39c" }, "downloads": -1, "filename": "datatables-0.3.zip", "has_sig": false, "md5_digest": "8105a69bdc9ca2b8b0778caeaaf9fd2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8453, "upload_time": "2014-08-11T09:52:41", "url": "https://files.pythonhosted.org/packages/21/20/cc8fb51754eb5531672f40e3f0bd809962ce37ca1a3fc0c6253f1d1d2158/datatables-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a6353bfabc34219122c76ec71c9252fe", "sha256": "bfa4992c10ff3a400493cf23ee7ed19bc7431f3266765228a7ddb1e389d36ef0" }, "downloads": -1, "filename": "datatables-0.4.zip", "has_sig": false, "md5_digest": "a6353bfabc34219122c76ec71c9252fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9098, "upload_time": "2014-08-11T16:20:46", "url": "https://files.pythonhosted.org/packages/23/48/3e3f0f39285db789b1f43fa15bd28c6297734529d7d43399b3c49cdd06ec/datatables-0.4.zip" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "488e5ddb05136bf27aac11253cff625c", "sha256": "2db42c1a9c1ce70377d480f0514d01e98d0e427566b1e9d7039b16833d7f6eb5" }, "downloads": -1, "filename": "datatables-0.4.1.zip", "has_sig": false, "md5_digest": "488e5ddb05136bf27aac11253cff625c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9135, "upload_time": "2014-08-12T08:27:45", "url": "https://files.pythonhosted.org/packages/d7/44/541c1d5a75a2ee94eb41ae7b02157b17742c8b21bf4a2409cfc405d0832b/datatables-0.4.1.zip" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "005813a8a9b4e56c20f2e373e08bcd1a", "sha256": "79357d8752451ddf81082f61296de15ad8a7ca4f023406685e4b707401399047" }, "downloads": -1, "filename": "datatables-0.4.2.zip", "has_sig": false, "md5_digest": "005813a8a9b4e56c20f2e373e08bcd1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9123, "upload_time": "2014-08-18T09:19:38", "url": "https://files.pythonhosted.org/packages/87/74/12f4aca4f6cd794bfd04a0105e18d3f7c592340aa0abc7ba709626e5e66e/datatables-0.4.2.zip" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "696c5d06de5f68a9c3f4b5954ea79731", "sha256": "59956c064bbc3ca4b615f11c444b7a7aa357bb35de1e06fd8c92b38534983878" }, "downloads": -1, "filename": "datatables-0.4.4.zip", "has_sig": false, "md5_digest": "696c5d06de5f68a9c3f4b5954ea79731", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9144, "upload_time": "2014-09-09T10:31:56", "url": "https://files.pythonhosted.org/packages/62/55/948d2e52eca0f3482ffac11f2c639c7bb4c58cf8c6520613baf211aca481/datatables-0.4.4.zip" } ], "0.4.5": [ { "comment_text": "", "digests": { "md5": "411a6ee1f48d9b086cf6d60ebf88186a", "sha256": "8592bdb04f443c8ed3876373a27d34395265c184bc267c139079bafdb3a9990d" }, "downloads": -1, "filename": "datatables-0.4.5.zip", "has_sig": false, "md5_digest": "411a6ee1f48d9b086cf6d60ebf88186a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9077, "upload_time": "2014-12-22T19:39:34", "url": "https://files.pythonhosted.org/packages/42/1a/677ba5656f9e6c54e8b31772380f522dd01e18f7274e3d954e6b743b54bb/datatables-0.4.5.zip" } ], "0.4.6": [ { "comment_text": "", "digests": { "md5": "79cbcdf98a5eb86379f5e68a5b5baa6c", "sha256": "a26ba29ba3f2e19cd86e21afc21c129298a947a7e65d6915a22e42fb27666c05" }, "downloads": -1, "filename": "datatables-0.4.6.zip", "has_sig": false, "md5_digest": "79cbcdf98a5eb86379f5e68a5b5baa6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9045, "upload_time": "2014-12-22T19:42:09", "url": "https://files.pythonhosted.org/packages/33/f5/ec71e680d2ffcf98fb86538f6494a62f1a04c6db62fd13fdd0d373e6ec6f/datatables-0.4.6.zip" } ], "0.4.9": [ { "comment_text": "", "digests": { "md5": "a682cc2e0b2d2f58cc7036c76535e5e4", "sha256": "c9cbe8261e2abf134987de22a3313558c7f4b1b842596d0987c06326b1ea7a2b" }, "downloads": -1, "filename": "datatables-0.4.9.zip", "has_sig": false, "md5_digest": "a682cc2e0b2d2f58cc7036c76535e5e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9081, "upload_time": "2015-01-06T13:49:53", "url": "https://files.pythonhosted.org/packages/d0/a2/53397d6f6f3322007741b1677e203f5c31db5236098cf25123f4ebecd1ea/datatables-0.4.9.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a682cc2e0b2d2f58cc7036c76535e5e4", "sha256": "c9cbe8261e2abf134987de22a3313558c7f4b1b842596d0987c06326b1ea7a2b" }, "downloads": -1, "filename": "datatables-0.4.9.zip", "has_sig": false, "md5_digest": "a682cc2e0b2d2f58cc7036c76535e5e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9081, "upload_time": "2015-01-06T13:49:53", "url": "https://files.pythonhosted.org/packages/d0/a2/53397d6f6f3322007741b1677e203f5c31db5236098cf25123f4ebecd1ea/datatables-0.4.9.zip" } ] }