{ "info": { "author": "Souheil Chelfouh", "author_email": "souheil@chelfouh.com", "bugtrack_url": null, "classifiers": [ "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": "==============\ndolmen.content\n==============\n\nThe package `dolmen.content` is a convenient way to define content\ntypes.\n\n.. contents::\n\nAbout\n=====\n\nContent types usually have several attributes defined in a\nschema and a name. In addition, they often need security to control the\ncreation or the modification (update, deletion, etc.). This is what\nprovides `dolmen.content`, with an easy-to-use set of grok directives.\n\nExample\n=======\n\nA `dolmen.content` content is declared as a simple class. Some\ndirectives are available to define your content: `name`, `schema` and\n`factory`. To have detailed information about these directives, please\nhave a look at the package tests.\n\n\nDefining the content\n--------------------\n\nLet's demonstrate the package's features with a simple and\nnon-exhaustive test::\n\n >>> import dolmen.content\n >>> from zope import schema\n >>> from zope.interface import Interface\n\n >>> class IContentSchema(Interface):\n ... text = schema.Text(title=u\"A body text\", default=u\"N/A\")\n\n >>> class MyContent(dolmen.content.Content):\n ... \"\"\"A very simple content\n ... \"\"\"\n ... dolmen.content.schema(IContentSchema)\n ... dolmen.content.name(\"a simple content type\")\n\n\nSchema\n------\n\nThe content can now be instanciated. As we can see here, the object is\neffectively providing the schema, even without grokking::\n\n >>> MyContent.text\n \n\n >>> IContentSchema.implementedBy(MyContent)\n True\n\n >>> obj = MyContent()\n >>> obj.text\n u'N/A'\n\nThe content can also be instanciated providing initial values::\n\n >>> obj = MyContent(text=u\"This is a nice text !\")\n >>> obj.text\n u'This is a nice text !'\n\nEven though the schema has been applied and the content type\nboostrapped, the content type is not yet complete::\n\n >>> obj.__content_type__\n Traceback (most recent call last):\n ...\n AttributeError: 'MyContent' object has no attribute '__content_type__'\n\nTo get all the features of a `dolmen.content` Content, we need to\nregister our component : we need to grok it.\n\n\nGrokking\n--------\n\nWe register our component::\n\n >>> from grokcore.component import testing\n >>> testing.grok_component('mycontent', MyContent)\n True\n\nAn additional information is now available::\n\n >>> obj.__content_type__\n u'a simple content type'\n\nThe grokking process also allowed an automatic registration of a very\nconvenient factory as an utility.\n\n\nFactory\n-------\n\nWhen the content is grokked, a factory is registered, using the\nfull module and class dotted names. It allows us to query and\ninstanciate the content easily::\n\n >>> from zope.component import getUtility\n >>> factory = getUtility(dolmen.content.IFactory,\n ... name=\"dolmen.content.MyContent\")\n >>> factory\n \n\nThe factory will create your content type for you, when called::\n\n >>> obj = factory()\n >>> obj\n \n >>> obj.text\n u'N/A'\n\n >>> obj = factory(text=u\"This is as easy as it seems.\")\n >>> obj\n \n >>> obj.text\n u'This is as easy as it seems.'\n\nSecurity\n--------\n\nThe created content type has a basic security declaration. We can\nretrieve the value of the permission protecting the content type by\nusing the `require` directive::\n\n >>> dolmen.content.require.bind().get(obj)\n 'zope.ManageContent'\n\nPlease note that this security declaration is _not_ used anywhere in\n`dolmen.content`. It's provided as a convenient way to declare a\npermission at the content type level. The factory does not check this\npermission. If you need a permission checker at the factory level,\nplease provide your own factory : see the tests module, factory\nfolder, for examples.\n\n\nChangelog\n=========\n\n0.7.1 (2011-02-16)\n------------------\n\n* Added util function to retrieve the schema from a component. This\n deals with the martian new handling of baseclasses. `get_schema`\n should return the `schema` directive default value, even if called\n on a baseclass that does not define `schema`.\n\n\n0.7 (2011-02-11)\n----------------\n\nThis version is a major breakdown and is not backward compatible with\nthe previous ones:\n\n* `BaseContent` no longer exists. It has been merged with `Content`.\n\n* The `IBaseContent` interface is gone.\n\n* There are no longer any schema defined by default.\n\n* ``dolmen.content`` contents no longer provide a dublincore `title`\n property and are no longer \"attribute annotatable\" by default.\n\n\n0.6.2 (2011-02-10)\n------------------\n\n* Fixed inheritance bug: the properties of the parent classes were\n overriden, if defined in the schema. This has been solved by\n deferring the schema treatment in the class advisor and by using\n 'hasattr' instead of checking the class __dict__.\n\n\n0.6.1 (2011-02-02)\n------------------\n\n* Cleaned up the ZCML declarations, to be sure it includes all the\n needed dependencies.\n\n\n0.6 (2010-11-06)\n----------------\n\n* Cleaned up dependencies. ``zope.formlib`` is no longer used.\n\n* The code has been updated to work with the latest ``martian`` and\n ``grokcore.component``.\n\n* The `__content_type__` property is now a unicode string. This will\n convert the given name to unicode or die trying.\n\n\n0.5.1 (2010-07-13)\n------------------\n\n* Added `zope` domain translation for the `Title` label of the\n `IBaseContent` interface.\n\n\n0.5 (2010-07-13)\n----------------\n\n* Default factory now provides a valid `IFactory`\n implementation. Added tests to fix that.\n\n* Changed the policy of the `__content_type__` attribute\n computation. Tests have been added to prevent any changes and\n regression.\n\n* Added an util function to fetch the content type of an object or\n class.\n\n* The `IFactory` interface now allows empty `title` and `description`,\n in accordance with the base value of the generic factory and\n directives.\n\n\n0.4 (2010-07-13)\n----------------\n\n* Factories now provide a name and a description, in addition to the\n title. These attributes, by default, fetch the generated class\n directives' values.\n\n* Updated tests and improved the coverage.\n\n* The factories `name` attribute no longer returns a cooked i18n\n value, but the `name` directive's value of the generated\n class. The form has to take care of its own title now.\n\n\n0.3.1 (2010-02-22)\n------------------\n\n* Corrected a very important bug in the models instanciation. The\n simple instanciation was causing an infinite loop due to imports\n having the same name than the module classes. This is fixed and tests\n have been added to test this simple case and avoid regression.\n\n\n0.3 (2010-02-08)\n----------------\n\n* Using the new `grokcore.content` package, allowing to cut the `grok`\n dependency.\n\n* The `BaseContent` now sets a default `require` value at\n `zope.ManageContent`. This permission is _NOT_ used, it's just a\n convenient directive to implement your own security check.\n\n* Dependencies have been cut down. `zope.app` packages are no longer\n used. The tests module has been rewritten for a cleaner and clearer\n read.\n\n* Directive `icon` has been removed. The functionality will be\n implemented in a standalone package. ATTENTION, this might break\n your existing code !\n\n* Directive `schema` now works without grokking, using a\n `zope.interface` class advisor. This allows a flexible\n bootstrapping, even in non-grokked code.\n\n\n0.2.2 (2009-09-25)\n------------------\n\n* Using the last `dolmen.field` version with a bug fix.\n\n\n0.2.1 (2009-09-20)\n------------------\n\n* Added tests and cleaned the testing module.\n\n\n0.2 (2009-09-04)\n----------------\n\n* Added an OrderedContainer base class.\n\n\n0.1 (2009-09-01)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://gitweb.dolmen-project.org/", "keywords": "Grok Zope3 CMS Dolmen Content", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "dolmen.content", "package_url": "https://pypi.org/project/dolmen.content/", "platform": "Any", "project_url": "https://pypi.org/project/dolmen.content/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://gitweb.dolmen-project.org/" }, "release_url": "https://pypi.org/project/dolmen.content/0.7.1/", "requires_dist": null, "requires_python": null, "summary": "Dolmen content type framework", "version": "0.7.1" }, "last_serial": 791331, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "6871dd6a75ddce45fb2c3ed1fca3dbbc", "sha256": "12408e397e126ff630b85dace48290ad5976ff21005ac1c94de04971191fa021" }, "downloads": -1, "filename": "dolmen.content-0.2-py2.5.egg", "has_sig": false, "md5_digest": "6871dd6a75ddce45fb2c3ed1fca3dbbc", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 28741, "upload_time": "2009-09-04T10:50:19", "url": "https://files.pythonhosted.org/packages/48/0c/2289c6256c47587361515c420d144ceca44828c1195f7d939309bd79a82a/dolmen.content-0.2-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "2e2e33a26a874d248521996b01c4d621", "sha256": "e326438c0c488d5a7028fb710be088cfae742c8a8775c072322c38a0be130395" }, "downloads": -1, "filename": "dolmen.content-0.2.tar.gz", "has_sig": false, "md5_digest": "2e2e33a26a874d248521996b01c4d621", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9620, "upload_time": "2009-09-04T10:50:18", "url": "https://files.pythonhosted.org/packages/fd/40/06104750d42d0b52934af6cd43c0a5a4d39558c90c59321c71398d01bf13/dolmen.content-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ebd6c8dc8f8327eedefc6271ec30970b", "sha256": "3ed013cc83885dfddb4abfe1e586284d393d75422bce52eb12509ef3b216c9f3" }, "downloads": -1, "filename": "dolmen.content-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ebd6c8dc8f8327eedefc6271ec30970b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11025, "upload_time": "2009-10-20T23:17:11", "url": "https://files.pythonhosted.org/packages/8d/3b/171cd533ed5b3d25e005262bfd0099f4f5027a55c62abe32bbd046c1f453/dolmen.content-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "faa2fd9a941e4199d27a82cbbc9b8f04", "sha256": "34d6fee2ee4149945d773117675d188f99cb620db775e6777f4e71f443d57db9" }, "downloads": -1, "filename": "dolmen.content-0.2.2.tar.gz", "has_sig": false, "md5_digest": "faa2fd9a941e4199d27a82cbbc9b8f04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11130, "upload_time": "2009-10-25T22:27:40", "url": "https://files.pythonhosted.org/packages/c3/f8/8eea22006c7221366abaa8334347c1933078785fe53a151159fa397c88d3/dolmen.content-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7f7858229f3c364af92a7ab7fb22ae49", "sha256": "0164090ff8a3b20a97d8c93054a627d46a53133c1a2c629faed55de8354cbc59" }, "downloads": -1, "filename": "dolmen.content-0.3.tar.gz", "has_sig": false, "md5_digest": "7f7858229f3c364af92a7ab7fb22ae49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13496, "upload_time": "2010-02-08T10:38:32", "url": "https://files.pythonhosted.org/packages/c8/33/688c093f06eb6b2bb225e8470eb4d2fa451eb092625b482894434ddcec57/dolmen.content-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "821a0717c61a84daaf23a8c070a1d4e5", "sha256": "7b0dcea5267d1d7e0b295da34e4bdc9a08527020ee896246f337d4a3a3f5fd19" }, "downloads": -1, "filename": "dolmen.content-0.3.1.tar.gz", "has_sig": false, "md5_digest": "821a0717c61a84daaf23a8c070a1d4e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14194, "upload_time": "2010-02-22T12:22:51", "url": "https://files.pythonhosted.org/packages/a8/e4/e9754667a5a55ae7dcc924b03bfa7730c29a88cc1f1fd1222932bdb6fe22/dolmen.content-0.3.1.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f58b0aaca942cf1d83670ff6e8f1070c", "sha256": "3eda624ab0cc227d748e06926f9740d2d77445f0c3a5e9aa144040c2aa2f8da4" }, "downloads": -1, "filename": "dolmen.content-0.4.tar.gz", "has_sig": false, "md5_digest": "f58b0aaca942cf1d83670ff6e8f1070c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15379, "upload_time": "2010-07-13T00:28:34", "url": "https://files.pythonhosted.org/packages/d4/1e/bd2778b2ec5ae9797912a1ac602be81c780809d515da33361dde962d4cb8/dolmen.content-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "f5d04f48166951399f4b7f4fb54ccb68", "sha256": "8abbf60dd548a1b54842bd6eb321dbc12183c89c88639fc40e07c9b368b99d64" }, "downloads": -1, "filename": "dolmen.content-0.5.tar.gz", "has_sig": false, "md5_digest": "f5d04f48166951399f4b7f4fb54ccb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16332, "upload_time": "2010-07-13T17:39:55", "url": "https://files.pythonhosted.org/packages/47/7d/3fd916aefdc7ecdf8d9e4762c1470b4f7d6bc82f2b9f97b8489db421751d/dolmen.content-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "95214432b0b807c66da21efa3ae5aaad", "sha256": "064f2d23cb3286eaf4b36f8177cfe5966ee601e38219408d99cbbfb066408165" }, "downloads": -1, "filename": "dolmen.content-0.5.1.tar.gz", "has_sig": false, "md5_digest": "95214432b0b807c66da21efa3ae5aaad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16473, "upload_time": "2010-07-13T19:34:21", "url": "https://files.pythonhosted.org/packages/06/44/1719f7609e23b1673b15a323a0178a8df444841585d482a5bae85830319d/dolmen.content-0.5.1.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "ea84e29475c4e23c51d508e427c9c60f", "sha256": "bdab38c9bd8c4dc6cf96ff5e218eee6895b2450c87a4069050200b629433323f" }, "downloads": -1, "filename": "dolmen.content-0.6.tar.gz", "has_sig": false, "md5_digest": "ea84e29475c4e23c51d508e427c9c60f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14540, "upload_time": "2010-11-06T00:08:19", "url": "https://files.pythonhosted.org/packages/c7/ff/deac0c05aebc26222a9203483eeaab67d2ef3a7d4ce63a6adb4853e28351/dolmen.content-0.6.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "2a450979e70e2b515d7682acda664d52", "sha256": "6a9c2084dee39af88068f1a13f594983d9822440852112aad88475e3f76b205f" }, "downloads": -1, "filename": "dolmen.content-0.6.1.tar.gz", "has_sig": false, "md5_digest": "2a450979e70e2b515d7682acda664d52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17167, "upload_time": "2011-02-02T14:06:26", "url": "https://files.pythonhosted.org/packages/d2/1a/0f297c91d03815f09f0594d9a3f652a5d39975320a2680c0d1e26f0feb78/dolmen.content-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "2cabb5f545c582dd60278bb18a4689cb", "sha256": "a6bc806cc66ca77929f5d71aab5875d6f9a54d814200518617f206746de37563" }, "downloads": -1, "filename": "dolmen.content-0.6.2.tar.gz", "has_sig": false, "md5_digest": "2cabb5f545c582dd60278bb18a4689cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17368, "upload_time": "2011-02-10T10:49:15", "url": "https://files.pythonhosted.org/packages/dc/fb/fcf263450ca7887142b3928ad297e390397325588f1a3daad6cf38841360/dolmen.content-0.6.2.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "ec1b7c8087aa7eeee57082bd25eda533", "sha256": "8bfbe02784218c6740163aa14d82bd1aa4d4c4779d665464d5c83f3cc8115a33" }, "downloads": -1, "filename": "dolmen.content-0.7.0.tar.gz", "has_sig": false, "md5_digest": "ec1b7c8087aa7eeee57082bd25eda533", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17753, "upload_time": "2011-02-11T12:23:50", "url": "https://files.pythonhosted.org/packages/56/11/0126482a771b2087f83a06ce39ea8b8a3f2c844e4ac2275745a3900ec222/dolmen.content-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "daabebc5f0fa4ac1a7ef821111c44f13", "sha256": "a4433f836be45b7fc081ef6d1059c1c2904b806b6f422e57d6eb81ed49773fcf" }, "downloads": -1, "filename": "dolmen.content-0.7.1.tar.gz", "has_sig": false, "md5_digest": "daabebc5f0fa4ac1a7ef821111c44f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18272, "upload_time": "2011-02-16T21:05:24", "url": "https://files.pythonhosted.org/packages/6a/71/a0e4387489119d51be298ed21dae56f111a1025b5fa1f67d2c4042f3e5c2/dolmen.content-0.7.1.tar.gz" } ], "2.0a1": [ { "comment_text": "", "digests": { "md5": "524410fbf65ac421727761573ba1f50f", "sha256": "ce68d462881521f78de16002e0b41eff3f8a4de046887f46a0111b8e4d5e2dc7" }, "downloads": -1, "filename": "dolmen.content-2.0a1.tar.gz", "has_sig": false, "md5_digest": "524410fbf65ac421727761573ba1f50f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17497, "upload_time": "2011-05-04T16:39:56", "url": "https://files.pythonhosted.org/packages/ff/80/9fb0963b111b79fd2a8200e66a78c46126cd2d6e812f587cee5d52f7cca2/dolmen.content-2.0a1.tar.gz" } ], "2.0a2": [ { "comment_text": "", "digests": { "md5": "4f750b71cf56bab2615c19b2d1680e0e", "sha256": "2ab875e8e4f686d31d2cd896ce18e59b2faf2cc5aa479603cd460fbd450f8042" }, "downloads": -1, "filename": "dolmen.content-2.0a2.tar.gz", "has_sig": false, "md5_digest": "4f750b71cf56bab2615c19b2d1680e0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17607, "upload_time": "2011-06-14T15:42:04", "url": "https://files.pythonhosted.org/packages/29/38/f1c4c5105471abba8a7361f3b74dc765a93e7a4f80a248d097bdf9aae6e5/dolmen.content-2.0a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "daabebc5f0fa4ac1a7ef821111c44f13", "sha256": "a4433f836be45b7fc081ef6d1059c1c2904b806b6f422e57d6eb81ed49773fcf" }, "downloads": -1, "filename": "dolmen.content-0.7.1.tar.gz", "has_sig": false, "md5_digest": "daabebc5f0fa4ac1a7ef821111c44f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18272, "upload_time": "2011-02-16T21:05:24", "url": "https://files.pythonhosted.org/packages/6a/71/a0e4387489119d51be298ed21dae56f111a1025b5fa1f67d2c4042f3e5c2/dolmen.content-0.7.1.tar.gz" } ] }