{ "info": { "author": "Souheil Chelfouh", "author_email": "souheil@chelfouh.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "``menhir.contenttype.image`` provides an image-centered content type\nfor `Dolmen` based `Grok` applications.\n\nSchema\n======\n\nThe ``menhir.contenttype.image`` `Image` content provides a custom schema,\nextending the `IDescriptiveSchema` interface, from ``dolmen.app.content``::\n\n >>> from dolmen.app.content import IDescriptiveSchema\n >>> from menhir.contenttype.image import IImage\n\n >>> IImage.isOrExtends(IDescriptiveSchema)\n True\n\nThe `IImage` interface describes the image field, that is to store the\nuploaded image data. The field comes from ``dolmen.file``::\n\n >>> for attr, doc in IImage.namesAndDescriptions():\n ... print attr, ':', doc\n image : \n\n\nFactory\n=======\n\nThe ``menhir.contenttype.image`` `Image` content uses a ZODB Blob to\nstore the data. The `image` attribute of the factory class, `Image`,\nis a blob property from ``dolmen.blob``::\n\n >>> from menhir.contenttype.image import Image\n >>> Image.image\n \n\nThe instanciation is fairly straightforward::\n\n >>> import os.path\n >>> path = os.path.join(os.path.dirname(__file__), 'image.png')\n\n >>> imagefile = open(path)\n >>> image = Image(title=u\"My Image\", image=imagefile)\n >>> imagefile.close()\n\nThe factory is protected by a common ``dolmen.app.security`` right::\n\n >>> from dolmen.content import require\n >>> print require.bind().get(image)\n dolmen.content.Add\n\n\nIcon\n====\n\nThe content registers an icon, thanks to the ``dolmen.app.content``\npackage::\n\n >>> from zope.component import getMultiAdapter\n >>> from zope.publisher.browser import TestRequest\n\n >>> request = TestRequest()\n >>> icon = getMultiAdapter((image, request), name=\"icon\")\n >>> print icon\n \n\n\nView\n====\n\nThe content registers its own index view. It displays the image and a\ndownload link. To be able to display the content, we need it persisted\nin a locatable tree, as the links depend on the urls::\n\n >>> from zope.component.hooks import getSite\n >>> site = getSite()\n >>> site['image'] = image\n\nWe can now summon the view and render it. The view is a\n``dolmen.app.layout`` `Page`::\n\n >>> from dolmen.app.layout import Page\n >>> index = getMultiAdapter((image, request), name=\"index\")\n >>> isinstance(index, Page)\n True\n\n >>> index.update()\n >>> print index.content()\n

My Image

\n
\n

\n Download\n —\n 1 KB\n

\n
\n \n \n \n
\n
\n\nChangelog\n=========\n\n0.4 (2011-02-14)\n----------------\n\n* The schema now inherits from `IDescriptiveSchema` from\n ``dolmen.app.content`` and no longer from `IBaseContent` from\n ``dolmen.content``. This adds a `description` attribute along with\n the already existing `title`.\n\n\n0.3 (2011-01-13)\n----------------\n\n* Resources are now registered and declared thanks to ``fanstatic``.\n\n\n0.2 (2010-07-27)\n----------------\n\n* Packaging corrections.\n\n\n0.1 (2010-07-21)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/menhir.contenttype.image", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://tracker.trollfot.org/", "keywords": "Grok Zope3 CMS Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "menhir.contenttype.image", "package_url": "https://pypi.org/project/menhir.contenttype.image/", "platform": "Any", "project_url": "https://pypi.org/project/menhir.contenttype.image/", "project_urls": { "Download": "http://pypi.python.org/pypi/menhir.contenttype.image", "Homepage": "http://tracker.trollfot.org/" }, "release_url": "https://pypi.org/project/menhir.contenttype.image/0.4/", "requires_dist": null, "requires_python": null, "summary": "Dolmen content-type extension : image", "version": "0.4" }, "last_serial": 794696, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "36cf5db8111851e2e6964c0056e7606c", "sha256": "2bff571fdf25e60e5b747d15dce7a1291035181b033e5a74357b53d2e05674a0" }, "downloads": -1, "filename": "menhir.contenttype.image-0.1.tar.gz", "has_sig": false, "md5_digest": "36cf5db8111851e2e6964c0056e7606c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5890, "upload_time": "2010-07-21T20:18:59", "url": "https://files.pythonhosted.org/packages/25/fa/6ba89a5f4fd3f4a2f57d7bb89b52b153d2120bd0e7e2444aeabae289da19/menhir.contenttype.image-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "abc3b21c4b3b1a8b30d6713d43086274", "sha256": "71d6920ce72bbf6b12a7adf887a9802f9d4d169dd2c314311c17841fe8bf68bf" }, "downloads": -1, "filename": "menhir.contenttype.image-0.2.tar.gz", "has_sig": false, "md5_digest": "abc3b21c4b3b1a8b30d6713d43086274", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6561, "upload_time": "2010-07-27T22:11:56", "url": "https://files.pythonhosted.org/packages/a6/37/22a71e0abc12e1459c4cdc3becdce6104fd29203c3f5cfc91aabb4471338/menhir.contenttype.image-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a26c5009130a2bf34a41554be8011854", "sha256": "631ac1469c4e947af9f37af7bde49b45a563bd4c7cca03f516c0a1b27ecf3553" }, "downloads": -1, "filename": "menhir.contenttype.image-0.3.tar.gz", "has_sig": false, "md5_digest": "a26c5009130a2bf34a41554be8011854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6739, "upload_time": "2011-01-13T16:53:34", "url": "https://files.pythonhosted.org/packages/17/0a/f489f16660e4eda9cc5b0c5264187662497a4fac1fd5a8915beaefd4691a/menhir.contenttype.image-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "0d9e5d718470c6db5f9569e0650ac457", "sha256": "28c040d6a010ccd7505c64520de02f816d73a6b77a7b7ebe2fe1afcbdacb781b" }, "downloads": -1, "filename": "menhir.contenttype.image-0.4.tar.gz", "has_sig": false, "md5_digest": "0d9e5d718470c6db5f9569e0650ac457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6897, "upload_time": "2011-02-14T16:59:33", "url": "https://files.pythonhosted.org/packages/cc/30/a34bca9e585e1c9e08ad1963b48ac7b5cc1d26f6fa5ada068dcd95a68331/menhir.contenttype.image-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0d9e5d718470c6db5f9569e0650ac457", "sha256": "28c040d6a010ccd7505c64520de02f816d73a6b77a7b7ebe2fe1afcbdacb781b" }, "downloads": -1, "filename": "menhir.contenttype.image-0.4.tar.gz", "has_sig": false, "md5_digest": "0d9e5d718470c6db5f9569e0650ac457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6897, "upload_time": "2011-02-14T16:59:33", "url": "https://files.pythonhosted.org/packages/cc/30/a34bca9e585e1c9e08ad1963b48ac7b5cc1d26f6fa5ada068dcd95a68331/menhir.contenttype.image-0.4.tar.gz" } ] }