{ "info": { "author": "BlueDynamics Alliance", "author_email": "dev@bluedynamics.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Zope2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Overview\n========\n\n``cornerstone.soup`` provides a container for persistent records which are\nqueryable. It is a genric storage for mass-data in an isolated container. \nLight-weight records are stored in an ``IOBTree``. A Zope-Tool-Kit catalog in \nused to index values of interest. cornerstone.soup is no out-of-the-box \npackage. Its addressed to developers needing to solve the problem of storing \ntiny entities of mass-data, where heavy weight archetypes or dexterity are too \nmuch effort and are to slow. I.e if you need a container for non-CMSish content, \nlike votes, data from a poll, orders in a webshop, measuring data, or alike.\n\n\nUpdating\n========\n\nIn earlier days of this package we thought it's a good idea to persist the\nsoup data in persistent local components. That was quite a mistake, at least\nin Plone context, because GenericSetup purges local components when applying\nbase profiles - what you're normally not doing, but experience shows that shit\nhappens ;). So we changed the storage location to annotations on an acquireable,\n``ISoupAnnotatable`` providing context.\n\nFurther the soup API was designed as utility, which was basically a good idea,\nbut caused toubles when looking up ``SoupData`` after the storage change.\nWe used ``getSiteManager`` to access the Acquisition context, and encountered\ninconsistencies for accessing the Acquisition context from different site\nmanagers in Plone.\n\nThe second problem forced us more or less to abandon the utility pattern, the\nsoup object itself now acts as adapter for context and is looked up via\n``getSoup`` instead of a utility lookup. After updating, you'll get\n``NoLongerSupported`` errors when trying to access a soup which is provided and\nlooked up as utility. You'll have to change your code to use ``getSoup``,\nand remove the soup local component registration from your GS Profile(s).\n::\n\n >>> from cornerstone.soup import getSoup\n >>> soup = getSoup(context, 'mysoup')\n\nThe new package ships with data migration. After updating call\n``soup-controlpanel`` (in Plone) and run storage migration and remove persistent\nlocal component for each soup. Prior to running the storage migration the \nexisting soup data is inaccessible.\n\nDue to the fact that the soup was originally persisted to the ZOBD, it still\ninherits from SimpleItem. This will be changed with the release 3.0.\nKeep in mind that 3.0 will break installations with non-cleaned-up\ndatabases.\n\n\nUsage\n=====\n\n``SoupData`` objects are stored as annotation to an object providing the\n``ISoupAnnotatable`` interface.\n\nFor use inside Plone, provide ``ISoupAnnotatable`` via ``five.implements`` on\nthe plone site object usind ZCML.\n::\n\n \n\n``SoupData`` is looked up by ``id`` for a given context. This context acquires\nit's parent until ``ISoupAnnotatable`` is found, on which the ``SoupData`` is\nannotated by ``id``. Use ``getSoup`` function for this.\n::\n\n >>> from cornerstone.soup import getSoup\n >>> soup = getSoup(context, 'my_soup_id')\n >>> soup\n \n\nIf no ``SoupData`` is found for given id, a new one is created and annotated\nto ``ISoupAnnotatable``.\n\nWe must provide an ``ICatalogFactory`` implementation for each soup, registered\nas utility under the same ``id`` as ``SoupData`` is annotated.\n\nMake sure that Catalog is re-created each time catalog factory gets called. this\nis needed for correct record reindexing.\n::\n\n >>> from zope.interface import implements\n >>> from zope.catalog.catalog import Catalog\n >>> from zope.catalog.field import FieldIndex\n >>> from cornerstone.soup.interfaces import ICatalogFactory\n >>> class MyCatalogFactory(object):\n ... implements(ICatalogFactory)\n ... \n ... def __call__(self):\n ... catalog = Catalog()\n ... catalog[u'name'] = FieldIndex(field_name='name',\n ... field_callable=False)\n ... return catalog\n\nZCML.\n::\n\n \n\nA Soup can only contain ``Records``. A Record is a simple persistent object\nwhich accepts any keyword arguments on ``__init__`` time. This arguments are \nused as Record properties.\n\nCreate a Record and add it to soup.\n::\n\n >>> from cornerstone.soup import Record\n >>> record = Record(user='user1')\n >>> id = soup.add(record)\n\nCheck querying.\n::\n\n >>> [r for r in soup.query(user='user1')]\n []\n \n >>> [r for r in soup.query(user='nonexist')]\n []\n \nAdd some more Records.\n::\n\n >>> id = soup.add(Record(user='user1'))\n >>> id = soup.add(Record(user='user2'))\n >>> u1records = [r for r in soup.query(user='user1')]\n >>> u1records\n [, \n ]\n\nChange user attribute of one record.\n::\n\n >>> u1records[0].data['user'] = 'user2'\n\nThe query still returns the old result. The Record must be reindexed.\n::\n\n >>> [r for r in soup.query(user='user1')]\n [, \n ]\n \n >>> soup.reindex([u1records[0]])\n \n >>> u1 = [r for r in soup.query(user='user1')]\n >>> u1\n []\n \n >>> u2 = [r for r in soup.query(user='user2')]\n >>> u2\n [, \n ]\n\nYou can reindex all records in soup at once.\n::\n\n >>> all = [r for r in soup.data.values()]\n >>> all = sorted(all, key=lambda x: x.user)\n >>> all\n [, \n , \n ]\n \n >>> all[-1].data['user'] = 'user3'\n >>> soup.reindex()\n >>> [r for r in soup.query(user='user3')]\n []\n\nYou can also rebuild the catalog. In this case the catalog factory is called\nagain and the new catalog is used.\n\nAdd index with key name in catalog factory source.\n::\n\n >>> from zope.catalog.field import FieldIndex\n \n >>> catalog[u'name'] = FieldIndex(field_name='name',\n ... field_callable=False)\n\nSet name attribute on some record data, rebuild soup and check results.\n::\n\n >>> all[0].data['name'] = 'name'\n >>> all[1].data['name'] = 'name'\n >>> all[2].data['name'] = 'name'\n >>> soup.rebuild()\n >>> [r for r in soup.query(name='name')]\n [, \n , \n ]\n \n\nDelete records.\n::\n\n >>> del soup[all[0]]\n >>> [r for r in soup.query(name='name')]\n [, \n ]\n\nFor huge expected results we can query LazyRecords. They return the real record\non call.\n::\n\n >>> lazy = [l for l in soup.lazy(name='name')]\n >>> lazy\n [, \n ]\n \n >>> lazy[0]()\n \n\n\nText Index NG 3 support\n=======================\n\nThis package provides a zope3 index wrapper for textindexng3. It is located at\n``cornerstone.soup.ting.TingIndex``.\n\nYou can use textindexng3 to index multiple fields of record at once, and make\ncomplex queries to this index. See \n`Products.TextIndexNG3 `_\nfor more information.\n\nI you want to use textindexng3 with ``cornerstone.soup``, make sure package\n``zopyx.txng3.core`` is installed and it's ZCML is loaded. ``zopyx.txng3.core``\nis NO hard dependency of ``cornerstone.soup``.\n\nA ``TingIndex`` just expects field names as space separated string, or as\niterable. A catalog factory using ``TingIndex`` looks like this.\n::\n\n >>> class TingCatalogFactory(object):\n ... implements(ICatalogFactory)\n ... \n ... def __call__(self):\n ... catalog = Catalog()\n ... catalog[u'ting'] = TingIndex(field_name=('foo', 'bar', 'baz'),\n ... field_callable=False)\n ... return catalog\n\nRegister this catalog factory as utility, we use ``tingsoup`` in this\nexample.\n\nQuery textindexng3 using soup.\n::\n\n >>> soup = getSoup(site, 'tingsoup')\n >>> soup\n \n\nIndex some records.\n::\n \n >>> id = soup.add(Record(foo='foo', bar='bar', baz='baz'))\n >>> id = soup.add(Record(foo='foobar', bar='barbaz', baz='bazfoo'))\n >>> id = soup.add(Record(foo='aaa', bar='barrrr', baz='ccc'))\n\nand query them.\n::\n\n >>> query = {\n ... 'query': u'bar::and(bar*)',\n ... 'search_all_fields': True,\n ... }\n >>> [r.bar for r in soup.query(ting=query)]\n ['bar', 'barbaz', 'barrrr']\n\n\nContributors\n============\n\n * Robert Niederreiter \n * Jens Klein \n * Sven Plage\n\nChanges\n=======\n\n2.4.1.1\n-------\n\n- solve packaging problem\n 2012-10-11 - jensens\n\n2.4.1\n-----\n\n- fixed bug in clear with request cache\n 2012-10-11 - jensens\n\n- fixed strange bug in locator by removing superfluos check.\n 2012-10-11 - jensens\n\n2.4\n---\n\n- Add GenericSetup profile and register soup-controlpanel as configlet.\n Only configure if Products.CMFPlone is installed.\n 2011-01-12 - rnix\n- Create browser package and move browser related stuff there.\n 2011-01-12 - rnix\n- adopt documentation at some places.\n 2010-12-17 - rnix\n- add some sorting tests.\n 2010-12-17 - rnix\n\n2.3.2\n-----\n\n- return search result of txng wrapper as IFSet.\n 2010-12-17 - rnix\n- only modify query of FieldIndex if not already tuple.\n 2010-12-17 - rnix\n\n2.3.1\n-----\n\n- do not import ting interfaces to make cornerstone.soup work without\n textindexng3.\n 2010-12-16 - rnix\n\n2.3\n---\n\n- fixed move code if empty soup is moved.\n 2010-12-16 - rnix\n- implemented clear function.\n 2010-12-16 - rnix\n- add text index NG3 support.\n 2010-12-16 - rnix\n\n2.2\n---\n\n- added mechanism to point soups to a path with an existing soup, so \n mount points can be used from several sites. Also overhauled UI of \n control panel and added more information what happens on mount or \n move.\n 2010-11-16 - jensens\n\n2.1\n---\n\n- added working move mechanism.\n 2010-09-09 - jensens, rnix\n- added deepcopy support.\n 2010-09-09 - jensens\n- added length support for SoupData using BTree's Length.\n 2010-09-08 - jensens\n- overhauled control panel UI.\n 2010-09-08 - jensens\n- fix query bug. only convert single value to 2-tuple when search key\n refers to FieldIndex instance.\n 2010-07-20 - rnix\n- consider ``sort_index``, ``limit`` and ``reverse`` as query \n kwargs.\n 2010-07-20 - rnix\n\n2.0\n---\n\n- change API.\n 2010-06-18 - rnix\n- change storage strategy.\n 2010-06-18 - rnix\n\n1.0\n---\n\n- complete tests.\n 2009-12-02 - rnix\n- remove IIntIds and INameChooser dependencies.\n 2009-12-02 - rnix, jensens\n\n1.0b2\n-----\n\n- change namechoosing of records. Use ``uuid.uuid4()``.\n 2009-10-01 - rnix\n- add ``lazy`` function for querying huge results.\n 2009-10-01 - rnix\n- yield query result instead of collect in a list.\n 2009-09-29 - rnix\n\n1.0b1\n-----\n\n- initial work.\n rnix, jensens\n\nLicense\n=======\n\nCopyright (c) 2008-2010, BlueDynamics Alliance, Austria\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this \n list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this \n list of conditions and the following disclaimer in the documentation and/or \n other materials provided with the distribution.\n* Neither the name of the BlueDynamics Alliance nor the names of its \n contributors may be used to endorse or promote products derived from this \n software without specific prior written permission.\n \nTHIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance ``AS IS`` AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://dev.plone.org/collective/browser/cornerstone.soup", "keywords": "container data record catalog txng3", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "cornerstone.soup", "package_url": "https://pypi.org/project/cornerstone.soup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cornerstone.soup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://dev.plone.org/collective/browser/cornerstone.soup" }, "release_url": "https://pypi.org/project/cornerstone.soup/2.4.1.1/", "requires_dist": null, "requires_python": null, "summary": "Container with queryable Records for Zope 2", "version": "2.4.1.1" }, "last_serial": 788454, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "9299e8e771530fb54b888dbcd0815229", "sha256": "f323b74fc9dce20a1af3a2965f0dc628bdf64ff486e9b2c6b11b22fea88be406" }, "downloads": -1, "filename": "cornerstone.soup-1.0.tar.gz", "has_sig": false, "md5_digest": "9299e8e771530fb54b888dbcd0815229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 116328, "upload_time": "2009-12-02T21:04:09", "url": "https://files.pythonhosted.org/packages/2e/45/51c37fbe70c8ec783a8e3bf9a1550ed0edf08f4c541f73aa880ce2ffe424/cornerstone.soup-1.0.tar.gz" } ], "1.0b1": [ { "comment_text": "", "digests": { "md5": "07adbc6703f24ac009cbf2cee4ecffe3", "sha256": "72c62d4bafc71135bb836c4564d3199898d0303a31941ea2ac67dcf3c3fd5982" }, "downloads": -1, "filename": "cornerstone.soup-1.0b1.tar.gz", "has_sig": false, "md5_digest": "07adbc6703f24ac009cbf2cee4ecffe3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8747, "upload_time": "2009-09-28T10:56:15", "url": "https://files.pythonhosted.org/packages/a3/5e/f65bf67836d64894437441647230d85e79ae96436d0476d736b90399044b/cornerstone.soup-1.0b1.tar.gz" } ], "1.0b2": [ { "comment_text": "", "digests": { "md5": "7f48503e3b0d8aa4c8baab05e804ef05", "sha256": "e2fd108984cf060157303c372a67bc9c5c3a4c7400a03fc39124eee85f27ae27" }, "downloads": -1, "filename": "cornerstone.soup-1.0b2.tar.gz", "has_sig": false, "md5_digest": "7f48503e3b0d8aa4c8baab05e804ef05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8919, "upload_time": "2009-10-01T10:46:58", "url": "https://files.pythonhosted.org/packages/d1/9e/bdb1104956619142a0f674a7fc97f1f0177d5406d7d6ea80df696785d143/cornerstone.soup-1.0b2.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "6da5f8d7ba9b5a7018b0c9f84284da9c", "sha256": "382736d9e028885c6545d1a4f9e33bc1e8f062afb7811cd71a069120cb774739" }, "downloads": -1, "filename": "cornerstone.soup-2.0.tar.gz", "has_sig": false, "md5_digest": "6da5f8d7ba9b5a7018b0c9f84284da9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 121047, "upload_time": "2010-06-18T15:52:07", "url": "https://files.pythonhosted.org/packages/a8/03/695b867ca14d75338f65ab5f335cd6d3c8e04fa97bfe8c020dd9ec1b7e7e/cornerstone.soup-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "0543aeaab24e781cc39ee9f75fbd7a4c", "sha256": "18f9c91860aa371d1bc21b62d29526ec4501fcd97e3dfe2bca676112e30cb447" }, "downloads": -1, "filename": "cornerstone.soup-2.1.tar.gz", "has_sig": false, "md5_digest": "0543aeaab24e781cc39ee9f75fbd7a4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 122475, "upload_time": "2010-09-09T12:26:04", "url": "https://files.pythonhosted.org/packages/19/d6/6513b96feb45bfa57f82144ca52cb870f4e5674a826a273ed504e4e774aa/cornerstone.soup-2.1.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "fd9e27eb5680758892ca31e2fc87400c", "sha256": "321c0f959d4bcdfef2c0f1a764fc477e90562d088e0a161b875ad2e4c72bd8b6" }, "downloads": -1, "filename": "cornerstone.soup-2.2.tar.gz", "has_sig": false, "md5_digest": "fd9e27eb5680758892ca31e2fc87400c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 124380, "upload_time": "2010-11-16T17:20:33", "url": "https://files.pythonhosted.org/packages/fb/a8/14f96be4cd61a1d8a5f1e73c1430fafda73e03d10d99130a4afad2c92691/cornerstone.soup-2.2.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "5b1621cfb3cd36c07736d5997eee73d5", "sha256": "f33c47dfc0dc6256d69d9eab034def0e0214d4ece52731185ce8607b7ccd4bbe" }, "downloads": -1, "filename": "cornerstone.soup-2.3.tar.gz", "has_sig": false, "md5_digest": "5b1621cfb3cd36c07736d5997eee73d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128709, "upload_time": "2010-12-16T12:56:26", "url": "https://files.pythonhosted.org/packages/51/77/620125434c7b26618edef2b7d0230713882f5cce8ecb7e93a3daa162258b/cornerstone.soup-2.3.tar.gz" } ], "2.3.1": [ { "comment_text": "", "digests": { "md5": "728cd7720e73bc367960584d64841a4a", "sha256": "0c848c6ce85d62cbc4bbaf13a95ccda88c72ee059eb4ae3b446da62151fdc92a" }, "downloads": -1, "filename": "cornerstone.soup-2.3.1.tar.gz", "has_sig": false, "md5_digest": "728cd7720e73bc367960584d64841a4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128785, "upload_time": "2010-12-16T13:10:21", "url": "https://files.pythonhosted.org/packages/99/d8/6655c626e8df0b20860d3b427144882dbaebde10fc1a3058d13311a015e8/cornerstone.soup-2.3.1.tar.gz" } ], "2.3.2": [ { "comment_text": "", "digests": { "md5": "d4900b13175051763691d3a2498cdd21", "sha256": "83925df505a540cd7703141d867844c681e789d4e97bb3107c878d7f36c451e8" }, "downloads": -1, "filename": "cornerstone.soup-2.3.2.tar.gz", "has_sig": false, "md5_digest": "d4900b13175051763691d3a2498cdd21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 129056, "upload_time": "2010-12-17T17:06:26", "url": "https://files.pythonhosted.org/packages/ed/d9/535ce3b580e3ca3606a80c2f0200847f0b95c5c95255f646b0a8f9c58c16/cornerstone.soup-2.3.2.tar.gz" } ], "2.4": [ { "comment_text": "", "digests": { "md5": "540be13c373156a1b904d747d507d58a", "sha256": "21887ddd4ceb84f7de094b1deaba1d49d8b5dd10ad23dd71fa9f4eb3d5772ce2" }, "downloads": -1, "filename": "cornerstone.soup-2.4.tar.gz", "has_sig": false, "md5_digest": "540be13c373156a1b904d747d507d58a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132727, "upload_time": "2011-01-12T11:54:48", "url": "https://files.pythonhosted.org/packages/07/f2/cb530b542949d28f2a596617ecd51ed155f160b4a199757fdeea86a54eef/cornerstone.soup-2.4.tar.gz" } ], "2.4.1": [ { "comment_text": "", "digests": { "md5": "580f2af42e102575c3ee1dd456eb57cd", "sha256": "513490e6a1c534f72f7aa79f8e2b57c827f6be5db33b42659a0f66b97f2bf26b" }, "downloads": -1, "filename": "cornerstone.soup-2.4.1.tar.gz", "has_sig": false, "md5_digest": "580f2af42e102575c3ee1dd456eb57cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18881, "upload_time": "2012-10-11T16:02:47", "url": "https://files.pythonhosted.org/packages/8f/80/c1f5844f4f5304738c1d47d795585f195538fd1d205a09420ff7b8a0a76b/cornerstone.soup-2.4.1.tar.gz" } ], "2.4.1.1": [ { "comment_text": "", "digests": { "md5": "3ebea6ff904fa3183ef7090268279ced", "sha256": "5e3009c5d5f05ae8a4f97febdb91df5f4ba0ec05741220509d98c453a4aa8f48" }, "downloads": -1, "filename": "cornerstone.soup-2.4.1.1.tar.gz", "has_sig": false, "md5_digest": "3ebea6ff904fa3183ef7090268279ced", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132286, "upload_time": "2012-10-11T17:32:28", "url": "https://files.pythonhosted.org/packages/5f/b1/57bb5f09157f699056f98e593cb6265ae9b1cd0efbd7ed94b380b1d4b46e/cornerstone.soup-2.4.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ebea6ff904fa3183ef7090268279ced", "sha256": "5e3009c5d5f05ae8a4f97febdb91df5f4ba0ec05741220509d98c453a4aa8f48" }, "downloads": -1, "filename": "cornerstone.soup-2.4.1.1.tar.gz", "has_sig": false, "md5_digest": "3ebea6ff904fa3183ef7090268279ced", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132286, "upload_time": "2012-10-11T17:32:28", "url": "https://files.pythonhosted.org/packages/5f/b1/57bb5f09157f699056f98e593cb6265ae9b1cd0efbd7ed94b380b1d4b46e/cornerstone.soup-2.4.1.1.tar.gz" } ] }