{ "info": { "author": "Souheil Chelfouh", "author_email": "trollfot@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python" ], "description": "===========================\nmenhir.contenttype.document\n===========================\n\n``menhir.contenttype.document`` provides a text-centered content for\n`Dolmen` based `Grok` applications. This document type has a field\nallowing a WYSIWYG edition and indexes itself for full-text searches.\n\n\nSchema\n======\n\nA `Document` has a dedicated schema defining a text field, in addition\nof the base `IDescriptiveSchema`::\n\n >>> from dolmen.app.content import IDescriptiveSchema\n >>> from menhir.contenttype.document import IDocument\n\n >>> IDocument.isOrExtends(IDescriptiveSchema)\n True\n\n >>> from dolmen.content import schema\n >>> from menhir.contenttype.document import Document\n\n >>> IDocument in schema.bind().get(Document)\n True\n\nThe text field is called \"body\", as it is the document's body text::\n\n >>> for attr, doc in IDocument.namesAndDescriptions():\n ... print attr, ':', doc\n body : \n\n\nFactory\n=======\n\nIn order to create a `Document` content, the current user will have to\nbe granted the `dolmen.content.Add` permission, from the\n``dolmen.app.security`` package::\n\n >>> from dolmen.content import require\n >>> require.bind().get(Document)\n 'dolmen.content.Add'\n\n\nForms\n=====\n\nThe WYSIWYG widget is provided by ``dolmen.widget.tinymce``, using the\njavascript library TinyMCE and jQuery. The Add form and the Edit form\nwill display the widget, since ``menhir.contenttype.document``\nprovides a `FieldsCustomizer` adapter (see ``dolmen.forms.crud``\ndocumentation)::\n\n >>> from dolmen.forms.crud import Edit\n >>> mydoc = Document(title=u'Some title', body=u\"Some body\")\n\n >>> from zope.publisher.browser import TestRequest\n >>> request = TestRequest()\n\n >>> editform = Edit(mydoc, request)\n >>> editform.update()\n\n >>> editform.fields['body'].mode\n \n\n\nIndexation\n==========\n\nA `Document` is indexed in full-text, using an `ISearchableText`\nadapter::\n\n >>> from zope.index.text.interfaces import ISearchableText\n >>> indexer = ISearchableText(mydoc)\n >>> indexer.getSearchableText()\n (u'Some title', u'', u'Some body\\n\\n')\n\n >>> mydoc.body = u'

Rich content comes in HTML

'\n >>> indexer.getSearchableText()\n (u'Some title', u'', u'Rich content comes in **HTML**\\n\\n')\n\n >>> mydoc.description = u\"I'm described\"\n >>> indexer.getSearchableText()\n (u'Some title', u\"I'm described\", u'Rich content comes in **HTML**\\n\\n')\n\n\nView\n====\n\nA `Document` has its very own index view, allowing it to render in a\nsimple way, without the default field names (see\n``dolmen.forms.crud``)::\n\n >>> from zope.component import getMultiAdapter\n >>> view = getMultiAdapter((mydoc, request), name='index')\n\n >>> from dolmen.app.layout import Page\n >>> isinstance(view, Page)\n True\n\n >>> print view.content()\n
\n

Some title

\n

Rich content comes in HTML

\n
\n\nChangelog\n=========\n\n0.2 (2011-02-14)\n----------------\n\n* Updated to use `IDescriptiveContent` from ``dolmen.app.content``\n instead of `IBaseContent` from ``dolmen.content`` that non longer\n exists : a document now has a `description` attribute in addition to\n `title`. This change has been echoed in the indexer.\n\n* Updated dependencies.\n\n\n0.1 (2010-07-20)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/menhir.contenttype.document", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://gitweb.dolmen-project.org/", "keywords": "Grok Zope3 CMS Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "menhir.contenttype.document", "package_url": "https://pypi.org/project/menhir.contenttype.document/", "platform": "Any", "project_url": "https://pypi.org/project/menhir.contenttype.document/", "project_urls": { "Download": "http://pypi.python.org/pypi/menhir.contenttype.document", "Homepage": "http://gitweb.dolmen-project.org/" }, "release_url": "https://pypi.org/project/menhir.contenttype.document/0.2/", "requires_dist": null, "requires_python": null, "summary": "Dolmen contenttype extension : document", "version": "0.2" }, "last_serial": 794693, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3e72bae7062dc64bbe68a3e111d3c360", "sha256": "5aabc248716b52ac7e1e5b3f46b18e39bd71ff47678d7f38be8bc9a98b336331" }, "downloads": -1, "filename": "menhir.contenttype.document-0.1.tar.gz", "has_sig": false, "md5_digest": "3e72bae7062dc64bbe68a3e111d3c360", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5092, "upload_time": "2010-07-20T18:44:45", "url": "https://files.pythonhosted.org/packages/f4/36/cb07187053cd66c4c4ca4dc17a2388497d9adb1e48fb9bac483d2184ffe4/menhir.contenttype.document-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "212fcddfb83386654c0f5d947fae4ee5", "sha256": "be4c72efb1d259f966c3b58d0e46c808b1809b6ae68f5b253b2659970693b16a" }, "downloads": -1, "filename": "menhir.contenttype.document-0.2.tar.gz", "has_sig": false, "md5_digest": "212fcddfb83386654c0f5d947fae4ee5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5461, "upload_time": "2011-02-14T16:34:00", "url": "https://files.pythonhosted.org/packages/5d/c0/c94711398aa6a19322324c276ba8076104191ead35f82e75e35b567ae7b8/menhir.contenttype.document-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "212fcddfb83386654c0f5d947fae4ee5", "sha256": "be4c72efb1d259f966c3b58d0e46c808b1809b6ae68f5b253b2659970693b16a" }, "downloads": -1, "filename": "menhir.contenttype.document-0.2.tar.gz", "has_sig": false, "md5_digest": "212fcddfb83386654c0f5d947fae4ee5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5461, "upload_time": "2011-02-14T16:34:00", "url": "https://files.pythonhosted.org/packages/5d/c0/c94711398aa6a19322324c276ba8076104191ead35f82e75e35b567ae7b8/menhir.contenttype.document-0.2.tar.gz" } ] }