{ "info": { "author": "Andrew Plummer", "author_email": "plummer574@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Flask", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "Flask Table\n===========\n\nBecause writing HTML is fiddly and all of your tables are basically the\nsame.\n\nQuick Start\n===========\n\n.. code:: python\n\n # import things\n from flask_table import Table, Col\n\n # Declare your table\n class ItemTable(Table):\n name = Col('Name')\n description = Col('Description')\n\n # Get some objects\n class Item(object):\n def __init__(self, name, description):\n self.name = name\n self.description = description\n items = [Item('Name1', 'Description1'),\n Item('Name2', 'Description2'),\n Item('Name3', 'Description3')]\n # Or, equivalently, some dicts\n items = [dict(name='Name1', description='Description1'),\n dict(name='Name2', description='Description2'),\n dict(name='Name3', description='Description3')]\n\n # Or, more likely, load items from your database with something like\n items = ItemModel.query.all()\n\n # Populate the table\n table = ItemTable(items)\n\n # Print the html\n print(table.__html__())\n # or just {{ table }} from within a Jinja template\n\nWhich gives something like:\n\n.. code:: html\n\n
| Name | Description |
|---|---|
| Name1 | Description1 |
| Name2 | Description2 |
| Name3 | Description3 |