{ "info": { "author": "Alec Mitchell, Mika Tasich", "author_email": "apm13@columbia.edu", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Programming Language :: Python" ], "description": "Introduction\n============\n\nThis package allows you to use `plone.app.relations` based relations\nin an Archetypes field. It exposes the same API as standard AT references\ndo, making it a simple drop-in replacement.\n\nTest\n====\n\nPrime tests, and set up our components and some basic content\n\n >>> from plonerelations.ATField import tests\n >>> tests.base_setup(portal)\n >>> ob1 = portal['ob1']\n >>> ob2 = portal['ob2']\n >>> ob3 = portal['ob3']\n >>> ob4 = portal['ob4']\n >>> ob5 = portal['ob5']\n\nImport fields, create instance of it, make it multi valued\n\n >>> from plonerelations.ATField.ploneRelationsATField import PloneRelationsATField\n >>> multiValueATField = PloneRelationsATField ()\n >>> multiValueATField.multiValued = True\n >>> multiValueATField.relationship = 'test multi valued relationship'\n\nMake a single value one, for good measure\n\n >>> singleValueATField = PloneRelationsATField ()\n >>> singleValueATField.multiValued = False\n >>> singleValueATField.relationship = 'test single relationship'\n\nCreate an Interface\n\n >>> from zope.interface import Interface\n >>> class IMyInterface (Interface):\n ... pass\n\nset relationship_interface on ATFields\n\n >>> multiValueATField.relationship_interface = IMyInterface\n >>> singleValueATField.relationship_interface = IMyInterface\n\nmake multi relationship from ob1 to objs 2 and 3, and a single relathionship from ob4 to ob5\n\n >>> singleValueATField.set ( ob4, ob5 )\n >>> multiValueATField.set ( ob1, [ob2,ob3] )\n\ntest if get method returns right objects. Multi returns a list\n\n >>> list (multiValueATField.get( ob1 ))\n [, ]\n\n >>> list (multiValueATField.getRaw( ob1, aslist=False))\n ['ob2', 'ob3']\n >>> list (multiValueATField.getRaw( ob1, aslist=True ))\n ['ob2', 'ob3']\n\nsinlge returns an object\n\n >>> singleValueATField.get ( ob4 )\n \n\n >>> singleValueATField.getRaw( ob4, aslist=False )\n 'ob5'\n\n >>> singleValueATField.getRaw( ob4, aslist=True )\n ['ob5']\n\ndouble check if plone.app.interface returns the same\n\n >>> from plone.app.relations import interfaces\n >>> multiValueSource = interfaces.IRelationshipSource(ob1)\n >>> singleValueSource = interfaces.IRelationshipSource(ob4)\n >>> multiValueRelationships = list(multiValueSource.getRelationships())\n >>> singleValueRelationship = list(singleValueSource.getRelationships())\n >>> multiValueRelationships\n [,) to (,)>, ,) to (,)>]\n >>> singleValueRelationship\n [,) to (,)>]\n\ncheck if relathionshiops provide Interfaces\n\n >>> IMyInterface.providedBy (singleValueRelationship[0])\n True\n >>> IMyInterface.providedBy (multiValueRelationships[0])\n True\n\ncheck if it deletes\n\n >>> multiValueATField.set ( ob1, [ob2,ob5] )\n >>> list(multiValueSource.getRelationships())\n [,) to (,)>, ,) to (,)>]\n >>> singleValueATField.set ( ob4, ob1 )\n >>> singleValueRelationship = list(singleValueSource.getRelationships())\n >>> singleValueRelationship\n [,) to (,)>]\n\nChangelog\n=========\n\n1.0 - 2011-10-10\n----------------\n\n- Removed `__implements__` for compatibility with Plone 4.\n [hannosch]\n\n- Update distribution metadata, some code cleanup.\n [hannosch]\n\n0.1 - May 20, 2008\n------------------\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/plonerelations.ATField", "keywords": "plone.relation field widget archetypes", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "plonerelations.ATField", "package_url": "https://pypi.org/project/plonerelations.ATField/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/plonerelations.ATField/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/plonerelations.ATField" }, "release_url": "https://pypi.org/project/plonerelations.ATField/1.0/", "requires_dist": null, "requires_python": null, "summary": "ATField for plone.relations", "version": "1.0" }, "last_serial": 661250, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "50453de99e8a344cabd1dfcc48400a1e", "sha256": "a6aa25ecb711830bc47fabef175c03636d3c919125f5773306e94c1b5e60da01" }, "downloads": -1, "filename": "plonerelations.ATField-0.1.tar.gz", "has_sig": false, "md5_digest": "50453de99e8a344cabd1dfcc48400a1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11214, "upload_time": "2008-05-20T12:14:23", "url": "https://files.pythonhosted.org/packages/99/20/c6f88bf5bb0dbbfa74bf99a45a7c3e17c0addf9310f5f34ec447fde62ea2/plonerelations.ATField-0.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "12330c1fbf5a9f9a13dc72e47847cdc8", "sha256": "d2aa1fbca2f1df98d41b3a8ab17002e5f295255ec34b75ae1f63910ed53f4478" }, "downloads": -1, "filename": "plonerelations.ATField-1.0.zip", "has_sig": false, "md5_digest": "12330c1fbf5a9f9a13dc72e47847cdc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16470, "upload_time": "2011-10-10T11:27:32", "url": "https://files.pythonhosted.org/packages/ba/ef/e45b380d78fcda095da5e6c6e9d666f6c8e49a5ffda866c4fa3314a48a3a/plonerelations.ATField-1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "12330c1fbf5a9f9a13dc72e47847cdc8", "sha256": "d2aa1fbca2f1df98d41b3a8ab17002e5f295255ec34b75ae1f63910ed53f4478" }, "downloads": -1, "filename": "plonerelations.ATField-1.0.zip", "has_sig": false, "md5_digest": "12330c1fbf5a9f9a13dc72e47847cdc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16470, "upload_time": "2011-10-10T11:27:32", "url": "https://files.pythonhosted.org/packages/ba/ef/e45b380d78fcda095da5e6c6e9d666f6c8e49a5ffda866c4fa3314a48a3a/plonerelations.ATField-1.0.zip" } ] }