{ "info": { "author": "Souheil Chelfouh", "author_email": "souheil@chelfouh.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "``menhir.contenttype.folder`` provides a folderish content for\n`Dolmen` based `Grok` applications. This folderish type has several\nways to display itself, allowing the editor to chose wether it should\ndisplay a summary of the content or a structured and pagined rendering.\n\nSchema\n======\n\nA `Folder` does not have a particular schema. It uses only the\n`IDescriptiveSchema` from ``dolmen.app.content``, exposing only the\n`title` and `description` attributes::\n\n >>> from dolmen.content import schema\n >>> from menhir.contenttype.folder import Folder\n >>> print schema.bind().get(Folder)\n []\n\nThe instanciation provides a fully functionnal folderish object::\n\n >>> from zope.container.interfaces import IContainer\n >>> folder = Folder(title=u\"Some title\")\n >>> IContainer.providedBy(folder)\n True\n\nThe `Folder` class inherits from the ``grokcore.content``\nOrderedContainer: the keys of container are orderable (read mutable)::\n\n >>> from grokcore.content import OrderedContainer\n >>> isinstance(folder, OrderedContainer)\n True\n\n\nTest in-situ\n============\n\nSetup the environment\n\n >>> from zope.component.hooks import getSite\n >>> root = getSite()\n\nCreate a Folder.\n\n >>> from menhir.contenttype.folder import Folder\n >>> root[u'folder'] = Folder()\n >>> folder = root.get(u'folder')\n\nCreate a dummy content type, so that we can put dummy content in the folder.\n\n >>> import dolmen.content as content\n >>> class Dummy(content.Content):\n ... content.name(\"Dummy\")\n ... # content.icon(\"dummy.png\")\n\nFill the folder with some dummies.\n\n >>> folder[u'books'] = Dummy(title=u\"Books\")\n >>> folder[u'films'] = Dummy(title=u\"Films\")\n >>> folder[u'music'] = Dummy(title=u\"Music\")\n\n >>> folder[u'subfolder'] = Folder(title=u\"SubFolder\")\n >>> folder[u'subfolder'][u'subfolder2'] = Folder(title=u'SubFolder Two')\n >>> folder[u'subfolder'][u'bogus'] = Dummy(title=u'Bogus') \n >>> folder[u'subfolder'][u'subfolder2'][u'hocus'] = Dummy(title=u\"hocus\")\n\nVerify the contents are correct.\n\n >>> dict([x for x in folder.items()])\n {u'films': ,\n u'books': ,\n u'music': ,\n u'subfolder': }\n\nLet's take a look at it from the browser's point-of-view.\n\n >>> from zope.publisher.browser import TestRequest\n >>> from zope.component import getMultiAdapter\n >>> request = TestRequest()\n\n >>> view = getMultiAdapter((folder, request), name=folder.selected_view)\n >>> view.__class__.__name__\n 'FolderListing'\n\n >>> view.update()\n >>> print view.render()\n
\n

Content of the folder

\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
TitleModification date
books
films
music
\"Folder\" SubFolder
\n
\n\nWe should have a look at the default view (index) as well.\n\n >>> view = getMultiAdapter((folder, request), name='index')\n >>> view.__class__.__name__\n 'SelectedView'\n\n >>> view.update()\n >>> print view.render()\n
\n

Content of the folder

\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
TitleModification date
books
films
music
\"Folder\" SubFolder
\n
\n\nLastly, let's change the folder layout to the full rendering view\nprovided in this package.\n\n >>> folder.selected_view = u'compositeview'\n >>> view = getMultiAdapter((folder, request), name=folder.selected_view)\n >>> view.__class__.__name__\n 'CompositeView'\n\n >>> view.update()\n >>> print view.content()\n
\n

\n
\n
\n

books

\n
\n
\n
\n
\n
\n

films

\n
\n
\n
\n
\n
\n

music

\n
\n
\n
\n
\n
\n

Content of the folder

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
TitleModification date
\"Folder\" SubFolder Two
bogus
\n \n
\n
\n
\n
\n\nChangelog\n=========\n\n0.4 (2011-02-14)\n----------------\n\n* The schema no longer includes `IViewSelector`. This prevents the\n field from showing up in the auto-generated forms.\n\n* `IFolder` now inherits from ``zope.container`` `IContainer`.\n\n* Consolidated the \"composite view\" using a normalized way to get the\n default view name. We now test if the view exists and if it's a\n valid `IPage`.\n\n\n0.3 (2011-02-14)\n----------------\n\n* Updated for the latest changes in ``dolmen.content``,\n ``dolmen.app.content`` and ``dolmen.app.container``.\n\n* Cleaned up dependencies.\n\n\n0.2 (2010-07-27)\n----------------\n\n* Corrected packaging (missing icon)\n\n\n0.1 (2010-07-19)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/menhir.contenttype.folder", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.dolmen-project.org/", "keywords": "Grok Zope3 CMS Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "menhir.contenttype.folder", "package_url": "https://pypi.org/project/menhir.contenttype.folder/", "platform": "Any", "project_url": "https://pypi.org/project/menhir.contenttype.folder/", "project_urls": { "Download": "http://pypi.python.org/pypi/menhir.contenttype.folder", "Homepage": "http://www.dolmen-project.org/" }, "release_url": "https://pypi.org/project/menhir.contenttype.folder/0.4/", "requires_dist": null, "requires_python": null, "summary": "Dolmen contenttype extension : folder", "version": "0.4" }, "last_serial": 794695, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d80d4a291f9c1b0f267159430e76ff4e", "sha256": "c1c69b3e87e696ab3e76cac51c49609aef9b7790cb42d290d2671282219a5f64" }, "downloads": -1, "filename": "menhir.contenttype.folder-0.1.tar.gz", "has_sig": false, "md5_digest": "d80d4a291f9c1b0f267159430e76ff4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6553, "upload_time": "2010-07-19T17:37:10", "url": "https://files.pythonhosted.org/packages/7c/d3/4322136b44b7297960b75d0798d05590acd4a34c5c31dbb7cf316ecec9b5/menhir.contenttype.folder-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "d0b4f1d7957686cc03e2608522024da9", "sha256": "681b5aea50750ec47b85896701b073d1f1734a12b02e19f770c03f8f538ab971" }, "downloads": -1, "filename": "menhir.contenttype.folder-0.2.tar.gz", "has_sig": false, "md5_digest": "d0b4f1d7957686cc03e2608522024da9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7451, "upload_time": "2010-07-27T20:18:14", "url": "https://files.pythonhosted.org/packages/de/12/11db371e72e190c364d11f0cb0b96b9739d33ec7b9c4cfffdb5597dd041e/menhir.contenttype.folder-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "cf973a4c7b0b478d0e13160081159033", "sha256": "10d6a5e05156e7c7c3faf7f85436cda008bbebf5edf97801a93beebff5415945" }, "downloads": -1, "filename": "menhir.contenttype.folder-0.3.tar.gz", "has_sig": false, "md5_digest": "cf973a4c7b0b478d0e13160081159033", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7649, "upload_time": "2011-02-14T15:51:49", "url": "https://files.pythonhosted.org/packages/d2/e8/836a62fdf601a5b8378d1d2de78d31146ae1d65fe6de4a6b55cd128b66f9/menhir.contenttype.folder-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "0bee4bc138c00d8f9f48e0d30e4b22c1", "sha256": "3bd4ed44aac5e38054999a330a193bc774e33a117515fc1f0022ac5b7e271cc2" }, "downloads": -1, "filename": "menhir.contenttype.folder-0.4.tar.gz", "has_sig": false, "md5_digest": "0bee4bc138c00d8f9f48e0d30e4b22c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8038, "upload_time": "2011-02-14T23:46:43", "url": "https://files.pythonhosted.org/packages/ae/8c/da2ff43d87030d53ec9c377e2dc2fe25d74f62b1c433db2841029030cea5/menhir.contenttype.folder-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0bee4bc138c00d8f9f48e0d30e4b22c1", "sha256": "3bd4ed44aac5e38054999a330a193bc774e33a117515fc1f0022ac5b7e271cc2" }, "downloads": -1, "filename": "menhir.contenttype.folder-0.4.tar.gz", "has_sig": false, "md5_digest": "0bee4bc138c00d8f9f48e0d30e4b22c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8038, "upload_time": "2011-02-14T23:46:43", "url": "https://files.pythonhosted.org/packages/ae/8c/da2ff43d87030d53ec9c377e2dc2fe25d74f62b1c433db2841029030cea5/menhir.contenttype.folder-0.4.tar.gz" } ] }