{ "info": { "author": "Souheil Chelfouh", "author_email": "trollfot@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "============\ndolmen.field\n============\n\nThe `dolmen.field` package provides additional generic fields to\nextend `zope.schema`.\n\n\nConfiguration fields\n====================\n\nThe configuration fields are used for description and constraints, to\nimpose a consistent schema and data model.\n\nGlobalClass\n-----------\n\n`GlobalClass` is a field requiring a valid Interface class. It can be\nused for factories and other components that need to store an\ninterface with the possibility to check and verify the consistency of\nthe given value::\n\n >>> from zope.interface import Interface\n >>> from dolmen.field import GlobalClass, IClassField\n\n >>> class IDummy(Interface):\n ... def shall_fail():\n ... pass\n\n >>> class Dummy(object):\n ... pass\n\nOf course, it must be a valid interface::\n\n >>> field = GlobalClass(\n ... title=u'a class field',\n ... schema=object\n ... )\n Traceback (most recent call last):\n ...\n WrongType: is not a valid Interface\n\nThe interface will be used to validate the class::\n \n >>> field = GlobalClass(\n ... title=u'a class field',\n ... schema=IDummy\n ... )\n\n >>> field.schema\n \n >>> IClassField.providedBy(field)\n True\n\nWe make sure the `interface` attribute is not touched::\n \n >>> print field.interface\n None\n\nIn a first time, we make sure the class implements the needed interface::\n\n >>> field._validate(Dummy)\n Traceback (most recent call last):\n ...\n ConstraintNotSatisfied: does not implement \n \n >>> from zope.interface import classImplements\n >>> classImplements(Dummy, IDummy)\n >>> IDummy.implementedBy(Dummy)\n True\n\nThen the interface acts as a strict validator::\n\n >>> field._validate(Dummy)\n Traceback (most recent call last):\n ...\n BrokenImplementation: An object has failed to implement interface \n \n The shall_fail attribute was not provided.\n \n\n >>> Dummy.shall_fail = lambda x: u'not'\n >>> field._validate(Dummy) is None\n True\n\n\nChangelog\n=========\n\n0.3 (2009-10-25)\n----------------\n\n.. attention: \n\n This version is *not* compatible with the previous ones.\n\n* Refactored the field to use the 'schema' attribute instead of\n 'interface'. The attribute name 'interface' was conflicting with\n other fields manipulating packages. \n\n* Now using a README.txt instead of inline doctests, for more\n readability.\n\n\n0.2 (2009-06-09)\n----------------\n\n* Initial Pypi release\n\n\n0.1 (2009-05-03)\n----------------\n\n* Internal release", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/dolmen.field", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://gitweb.dolmen-project.org", "keywords": "Grok Zope3 Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "dolmen.field", "package_url": "https://pypi.org/project/dolmen.field/", "platform": "Any", "project_url": "https://pypi.org/project/dolmen.field/", "project_urls": { "Download": "http://pypi.python.org/pypi/dolmen.field", "Homepage": "http://gitweb.dolmen-project.org" }, "release_url": "https://pypi.org/project/dolmen.field/0.3/", "requires_dist": null, "requires_python": null, "summary": "Generic Formlib fields", "version": "0.3" }, "last_serial": 791332, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "7b910669887016c07ecb8593851c5e9e", "sha256": "995dbf97b48a6b985d1930125203fa0cd490fcdce9a579959ea0be580d18725a" }, "downloads": -1, "filename": "dolmen.field-0.2.tar.gz", "has_sig": false, "md5_digest": "7b910669887016c07ecb8593851c5e9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5807, "upload_time": "2009-06-09T12:19:13", "url": "https://files.pythonhosted.org/packages/47/a9/c9748414b075e024cf01704b7f3e683c78f6970e44606060776fe73f4cde/dolmen.field-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "548ffc36e7aaaa4a47e7f157559d0e74", "sha256": "c42446b44628d36be6bfe85cc89a35936d5adccf13ff4f71ed384e3814cb25d6" }, "downloads": -1, "filename": "dolmen.field-0.3.tar.gz", "has_sig": false, "md5_digest": "548ffc36e7aaaa4a47e7f157559d0e74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3675, "upload_time": "2009-10-25T22:11:38", "url": "https://files.pythonhosted.org/packages/c1/8a/9d35e951bb0fa8601ce4d1ab695812cd07cf3ef3a0e7089e8d10fb3c6590/dolmen.field-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "548ffc36e7aaaa4a47e7f157559d0e74", "sha256": "c42446b44628d36be6bfe85cc89a35936d5adccf13ff4f71ed384e3814cb25d6" }, "downloads": -1, "filename": "dolmen.field-0.3.tar.gz", "has_sig": false, "md5_digest": "548ffc36e7aaaa4a47e7f157559d0e74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3675, "upload_time": "2009-10-25T22:11:38", "url": "https://files.pythonhosted.org/packages/c1/8a/9d35e951bb0fa8601ce4d1ab695812cd07cf3ef3a0e7089e8d10fb3c6590/dolmen.field-0.3.tar.gz" } ] }