{ "info": { "author": "Roger Ineichen and the Zope Community", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This package provides a table implementation including form support for Zope3 \r\nbased on z3c.form and z3c.table.\r\n\n\n.. contents::\n\n========\n Issues\n========\n\n- There is still an issue in README.txt sample, the samples are using nested\n ``
`` tags. Fix the sample and use real subform templates.\n\n\n=======\nCHANGES\n=======\n\n0.6.2 (2012-06-19)\n------------------\n\n- Made the pagetemplates provide macros to make it easier to replace specific\n contents\n\n\n0.6.1 (2012-06-19)\n------------------\n\n- Fixed package metadata (home page and author e-mail).\n\n- Added a default supportsCancel = False to TableBase\n\n0.6.0 (2010-10-28)\n------------------\n\n- Using ``registerType`` from `zope.browserpage` instead from\n `zope.app.pagetemplate`\n\n- Adjusted test output.\n\n- Updated test dependencies so tests run with current `z3c.form` versions.\n\n- Added doctests to ``long_description`` so they show up on PyPI.\n\n\n0.5.2 (2009-10-19)\n------------------\n\n- Fixed my bug introduced in 0.5.1.\n\n\n0.5.1 (2009-10-19)\n------------------\n\n- Added ``allowEdit`` property to ``SubFormTable``\n\n\n0.5.0 (2009-02-22)\n------------------\n\n- Initial release.\n\n\n==========\nForm Table\n==========\n\nThe goal of this package is to offer a modular table rendering library which\nincludes built in support for update forms. This will allow us to adapt items\nrendered as table row items to forms. This could prevent to use traversable\nexposed forms for such items. But this is just one of the benefits. See more\nbelow.\n\n\nForm support\n------------\n\nWe need to setup the form defaults first:\n\n >>> from z3c.form.testing import setupFormDefaults\n >>> setupFormDefaults()\n\nAnd load the formui confguration, which will make sure that all macros get\nregistered correctly.\n\n >>> from zope.configuration import xmlconfig\n >>> import zope.component\n >>> import zope.viewlet\n >>> import zope.component\n >>> import zope.app.publisher.browser\n >>> import z3c.macro\n >>> import z3c.template\n >>> import z3c.formui\n >>> xmlconfig.XMLConfig('meta.zcml', zope.component)()\n >>> xmlconfig.XMLConfig('meta.zcml', zope.viewlet)()\n >>> xmlconfig.XMLConfig('meta.zcml', zope.app.publisher.browser)()\n >>> xmlconfig.XMLConfig('meta.zcml', z3c.macro)()\n >>> xmlconfig.XMLConfig('meta.zcml', z3c.template)()\n >>> xmlconfig.XMLConfig('configure.zcml', z3c.formui)()\n\nAnd load the z3c.tabular configure.zcml:\n\n >>> import z3c.tabular\n >>> xmlconfig.XMLConfig('configure.zcml', z3c.tabular)()\n\n\nSample data setup\n-----------------\n\nLet's create a sample container which we can use as our iterable context:\n\n >>> from zope.container import btree\n >>> class Container(btree.BTreeContainer):\n ... \"\"\"Sample container.\"\"\"\n ... __name__ = u'container'\n >>> container = Container()\n\nand set a parent for the container:\n\n >>> root['container'] = container\n\nand create a sample content object which we use as container item:\n\n >>> import zope.interface\n >>> import zope.schema\n >>> class IContent(zope.interface.Interface):\n ... \"\"\"Content interface.\"\"\"\n ...\n ... title = zope.schema.TextLine(title=u'Title')\n ... number = zope.schema.Int(title=u'Number')\n\n >>> class Content(object):\n ... \"\"\"Sample content.\"\"\"\n ... zope.interface.implements(IContent)\n ... def __init__(self, title, number):\n ... self.__name__ = title.lower()\n ... self.title = title\n ... self.number = number\n\nNow setup some items:\n\n >>> container[u'first'] = Content('First', 1)\n >>> container[u'second'] = Content('Second', 2)\n >>> container[u'third'] = Content('Third', 3)\n\n\nFormTable setup\n---------------\n\nThe ``FormTable`` offers a sub form setup for rendering items within a form.\nLet's first define a form for our used items:\n\n\n >>> from z3c.form import form\n >>> from z3c.form import field\n >>> class ContentEditForm(form.EditForm):\n ... fields = field.Fields(IContent)\n\nNow we can define our ``FormTable`` including the SelectedItemColumn:\n\n >>> from z3c.table import column\n >>> import z3c.tabular.table\n >>> class ContentFormTable(z3c.tabular.table.SubFormTable):\n ...\n ... subFormClass = ContentEditForm\n ...\n ... def setUpColumns(self):\n ... return [\n ... column.addColumn(self, column.SelectedItemColumn,\n ... u'selectedItem', weight=1),\n ... ]\n\nAnd support the div form layer for our request:\n\n >>> from z3c.formui.interfaces import IDivFormLayer\n >>> from zope.interface import alsoProvides\n >>> from z3c.form.testing import TestRequest\n >>> request = TestRequest()\n >>> alsoProvides(request, IDivFormLayer)\n\nNow we can render our table. As you can see the ``SelectedItemColumn`` renders\na link which knows hot to select the item:\n\n >>> contentSubFormTable = ContentFormTable(container, request)\n >>> contentSubFormTable.__name__ = 'view.html'\n >>> contentSubFormTable.update()\n >>> print contentSubFormTable.render()\n \n
\n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name
first
second
third
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n\n\nNow we are ready to select an item by click on the link. We simulate this by\nset the relevant data in the request:\n\n >>> selectRequest = TestRequest(form={\n ... 'subFormTable-selectedItem-0-selectedItems': 'second'})\n >>> alsoProvides(selectRequest, IDivFormLayer)\n >>> selectedItemTable = ContentFormTable(container, selectRequest)\n >>> selectedItemTable.__name__ = 'view.html'\n >>> selectedItemTable.update()\n >>> print selectedItemTable.render()\n
\n
\n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name
first
second
third
\n
\n
\n
\n \n
\n
\n *– required\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n \n\n\nClicking the ``Edit`` button at the same time should hold the same result:\n\n >>> selectRequest = TestRequest(form={\n ... 'subFormTable-selectedItem-0-selectedItems': 'second',\n ... 'subFormTable.buttons.edit': 'Edit'})\n >>> alsoProvides(selectRequest, IDivFormLayer)\n >>> selectedItemTable = ContentFormTable(container, selectRequest)\n >>> selectedItemTable.__name__ = 'view.html'\n >>> selectedItemTable.update()\n >>> print selectedItemTable.render()\n
\n
\n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name
first
second
third
\n
\n
\n
\n \n
\n
\n *– required\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n \n\nUnless ``allowEdit`` is ``False``.\nIn this case the editform won't appear.\n\n >>> selectRequest = TestRequest(form={\n ... 'subFormTable-selectedItem-0-selectedItems': 'second',\n ... 'subFormTable.buttons.edit': 'Edit'})\n >>> alsoProvides(selectRequest, IDivFormLayer)\n >>> selectedItemTable = ContentFormTable(container, selectRequest)\n >>> selectedItemTable.__name__ = 'view.html'\n >>> selectedItemTable.allowEdit = False\n >>> selectedItemTable.update()\n >>> print selectedItemTable.render()\n
\n
\n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Name
first
second
third
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/z3c.tabular", "keywords": "zope3 z3c tabular data form table contents", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "z3c.tabular", "package_url": "https://pypi.org/project/z3c.tabular/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/z3c.tabular/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/z3c.tabular" }, "release_url": "https://pypi.org/project/z3c.tabular/0.6.2/", "requires_dist": null, "requires_python": null, "summary": "Table with form support based on z3c.form and z3c.table for Zope3", "version": "0.6.2" }, "last_serial": 802115, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "fd497fb12d2578ac50c3f087d763d9c3", "sha256": "907bf162fa21ff0c2fb4bb2089785ef803cda0184fba080b7093d3cb0810d858" }, "downloads": -1, "filename": "z3c.tabular-0.5.0.zip", "has_sig": false, "md5_digest": "fd497fb12d2578ac50c3f087d763d9c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16487, "upload_time": "2009-02-22T05:18:53", "url": "https://files.pythonhosted.org/packages/66/5d/732740fefedaf3d41c754d8285c66d5ac9d9cc0ad1bf4c2a49ad3c32dbd3/z3c.tabular-0.5.0.zip" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "69e3fc3ca1308767745330c6e0472497", "sha256": "a02d34b10b2d4220af7c04d9690978f3eb3f022eab457cfb7b0508e89f6fcba7" }, "downloads": -1, "filename": "z3c.tabular-0.5.1.tar.gz", "has_sig": false, "md5_digest": "69e3fc3ca1308767745330c6e0472497", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9839, "upload_time": "2009-10-19T14:03:51", "url": "https://files.pythonhosted.org/packages/69/c6/6011622212be41fed8517d9f9481881700088e33c980a31da857e3956f33/z3c.tabular-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "d835a49c60731685a29900ded94d9b26", "sha256": "c71c41e506b175c1234f8373b05cc96a0a9cf18f9870bb6818658024716161eb" }, "downloads": -1, "filename": "z3c.tabular-0.5.2.tar.gz", "has_sig": false, "md5_digest": "d835a49c60731685a29900ded94d9b26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9993, "upload_time": "2009-10-19T14:38:12", "url": "https://files.pythonhosted.org/packages/3e/3e/e7266d33dda9258cbeeebfbfb3c606306396a1f15a43f4ea16737e7c249b/z3c.tabular-0.5.2.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "928dea08fa15406c187e1ca9475baf04", "sha256": "e42f77f40855959e3595e8c3980cebfd6fe3c63ad5c921580636048a721be539" }, "downloads": -1, "filename": "z3c.tabular-0.6.0.tar.gz", "has_sig": false, "md5_digest": "928dea08fa15406c187e1ca9475baf04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12868, "upload_time": "2010-10-28T11:13:16", "url": "https://files.pythonhosted.org/packages/fa/b8/2d20192837540b8c805446aba8457c20c976da8652e1e9fb32177e8877de/z3c.tabular-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "42bba64011ffbe8213dc89a375809b9f", "sha256": "adc751b58ec20f5e2702c7650aede07c06a70324d9d28139a8352d96027ccda7" }, "downloads": -1, "filename": "z3c.tabular-0.6.1.zip", "has_sig": false, "md5_digest": "42bba64011ffbe8213dc89a375809b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23348, "upload_time": "2012-06-19T11:32:41", "url": "https://files.pythonhosted.org/packages/cc/4d/dba8c61f6e3dc4b008a201bec34a6007890fce4b78ff633d27fd4d143595/z3c.tabular-0.6.1.zip" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "3d24962de2481beb8fd1b4c6596b70d9", "sha256": "5e135601da0e9b79e6b37b1dd46c4172d29f475c2b9d3207968fe6c09ca7c056" }, "downloads": -1, "filename": "z3c.tabular-0.6.2.zip", "has_sig": false, "md5_digest": "3d24962de2481beb8fd1b4c6596b70d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23594, "upload_time": "2012-06-19T15:51:13", "url": "https://files.pythonhosted.org/packages/b6/0a/47e661c2e44fcc6d8107d71c457f1e95aec5e01114ca9c8cc5e7bcf562b1/z3c.tabular-0.6.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d24962de2481beb8fd1b4c6596b70d9", "sha256": "5e135601da0e9b79e6b37b1dd46c4172d29f475c2b9d3207968fe6c09ca7c056" }, "downloads": -1, "filename": "z3c.tabular-0.6.2.zip", "has_sig": false, "md5_digest": "3d24962de2481beb8fd1b4c6596b70d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23594, "upload_time": "2012-06-19T15:51:13", "url": "https://files.pythonhosted.org/packages/b6/0a/47e661c2e44fcc6d8107d71c457f1e95aec5e01114ca9c8cc5e7bcf562b1/z3c.tabular-0.6.2.zip" } ] }