{ "info": { "author": "Maurits van Rees", "author_email": "m.van.rees@zestsoftware.nl", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 3.3", "Framework :: Plone :: 4.0", "Framework :: Plone :: 4.1", "Programming Language :: Python" ], "description": ".. contents::\n\n\nDocumentation\n=============\n\n\nTarget audience\n---------------\n\nThis is a package for integrators.\n\n \nInstallation and goal\n---------------------\n\nAdd collective.btrees to the eggs in your buildout. Add it to the\nzcml too, if you are on Plone 3.2 or lower. No need for further\ninstallation in the Plone UI.\n\nThis makes some small adapters available to store btrees in\nannotations on an object. There are adapters for all the btrees in\nthe ``BTrees`` module. The adapters make the public methods of btrees\navailable in the adapter. Use this when you want this and when you\nunderstand what this means. :-)\n\n\nExample usage\n-------------\n\nUsually you will want to create an own adapter to override some\nsettings, at least the key used to store the annotations. Put this in\nan adapters.py::\n\n from zope.interface import implements\n from zope.interface import Interface\n from collective.btrees.interfaces import IOOBTreeContainer\n from collective.btrees.adapters import OOBTreeContainer\n\n class IFormValuesContainer(IOOBTreeContainer):\n pass\n\n class FormValuesContainer(OOBTreeContainer):\n\n implements(IFormValuesContainer)\n ANNO_KEY = 'my.package.formvalues'\n\n def _check_key(self, key):\n if not isinstance(key, basestring):\n raise TypeError(\"base string expected as key\")\n\n def _check_value(self, value):\n if not isinstance(value, dict):\n raise TypeError(\"dictionary expected as value\")\n\nRegister the adapter in zcml::\n\n \n\nUse it within for example a browser view to store the request form\ndictionary in the btree (if this for some reason makes sense for your\nwebsite)::\n\n container = IFormValuesContainer(self.context)\n key = 'my key' # maybe use the user id as key\n value = self.request.form\n container.insert(key, value)\n container.get(key) # will return value\n\n\nCompatibility\n-------------\n\nI have tried this on Plone 3.3 and 4.1. It will likely work on other versions\nas well.\n\n\nAuthors\n-------\n\nMaurits van Rees\n\nChangelog\n=========\n\n\n1.1 (2012-06-05)\n----------------\n\n- Changed setup.py url to point to the github collective.\n [maurits]\n\n\n1.0 (2012-05-16)\n----------------\n\n- Initial release\n [maurits]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/collective.btrees", "keywords": "", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.btrees", "package_url": "https://pypi.org/project/collective.btrees/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.btrees/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/collective/collective.btrees" }, "release_url": "https://pypi.org/project/collective.btrees/1.1/", "requires_dist": null, "requires_python": null, "summary": "Add btrees in annotations", "version": "1.1" }, "last_serial": 739416, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "2b62b973c0debd8887074f572b19b087", "sha256": "eeba89b11400d26884d7adb06dae227e25a8ed48944ee07def12df406d3e9eb9" }, "downloads": -1, "filename": "collective.btrees-1.0.zip", "has_sig": false, "md5_digest": "2b62b973c0debd8887074f572b19b087", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14997, "upload_time": "2012-05-16T22:21:02", "url": "https://files.pythonhosted.org/packages/79/c9/d58336ac0cf3d923e501a077f8bb449d7f7873307d9958a598d65d723342/collective.btrees-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "f26a1fb2adb9012898cdbf0e7de0eeae", "sha256": "50f6c47cd6e08aba473f6f52ddbb1cecfd00af021beec6c73e7fdf0ac647fd33" }, "downloads": -1, "filename": "collective.btrees-1.1.zip", "has_sig": false, "md5_digest": "f26a1fb2adb9012898cdbf0e7de0eeae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15121, "upload_time": "2012-06-05T19:23:24", "url": "https://files.pythonhosted.org/packages/65/64/5083b6469626b55188e6eebb4250c47278f71db4911e76a9ddcd580cc99c/collective.btrees-1.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f26a1fb2adb9012898cdbf0e7de0eeae", "sha256": "50f6c47cd6e08aba473f6f52ddbb1cecfd00af021beec6c73e7fdf0ac647fd33" }, "downloads": -1, "filename": "collective.btrees-1.1.zip", "has_sig": false, "md5_digest": "f26a1fb2adb9012898cdbf0e7de0eeae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15121, "upload_time": "2012-06-05T19:23:24", "url": "https://files.pythonhosted.org/packages/65/64/5083b6469626b55188e6eebb4250c47278f71db4911e76a9ddcd580cc99c/collective.btrees-1.1.zip" } ] }