{
"info": {
"author": "Sylvain Viollon",
"author_email": "sylvain@infrae.com",
"bugtrack_url": null,
"classifiers": [
"Framework :: Plone",
"Framework :: Zope2",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "*************************************\nFormlib widget for plone.app.relation\n*************************************\n\n.. contents::\n\n\nThe purpose of this extension is to provide formlib widget to edit\nplone.app.relation relations. This have been tested with Plone 2.5 and\nPlone 3.\n\nInterface definition\n====================\n\nSimple interface for our contents, using the custom Zope 3 field for\nrelation::\n\n >>> from infrae.plone.relations.schema import PloneRelation\n >>> from zope.interface import implements, Interface\n >>> class ISimpleContent(Interface):\n ... \"\"\"Simple interface with relation.\"\"\"\n ... relation = PloneRelation(title=u\"A relation\",\n ... relation=\"relation1\")\n\n\nIn the user interface, Zope IntID are used to keep track of\nobject. You can also use Archetype UID (check the ``configure.zcml``\nfile), in this case all content must comes from the Referenceable\nclass of Archetype (``Products.Archetypes.Referenceable``).\n\n\nWidget definition\n=================\n\nThe plone relation widget is customisable, you can select different\nsub-widgets to select new items to add to relation. These sub-widgets\ncan takes arguments. For instance here, you can put a restriction on\n``content_type``.\n\nThe widget is built using ``CustomWidgetFactory``::\n\n >>> from infrae.plone.relations.form import PloneRelationEditWidget\n >>> from infrae.plone.relations.form import PloneRelationSearchAddWidget\n >>> from zope.app.form import CustomWidgetFactory\n >>> widget_factory = CustomWidgetFactory(PloneRelationEditWidget,\n ... add_widget=PloneRelationSearchAddWidget,\n ... add_widget_args=dict(content_type='MySimpleContent'))\n\nCurrently, there is three different widgets to add relations: one which\ndoes a catalog search with user input and let select result as object\nfor relation, one which list objects (from the catalog always), one\nwhich use a Zope 3 vocabulary as input.\n\nThe ``infrae.plone.relations.form.utility`` provides simples methods to\nbuild these widgets.\n\nForm definition\n===============\n\nNow, we will do a simple edit form for a content using this interface::\n\n >>> from Products.Five.formlib import formbase\n >>> from zope.formlib import form\n >>> class EditSimpleContentForm(formbase.EditForm):\n ... label = 'Edit form'\n ... description = 'Form to edit relation'\n ... form_fields = form.Fields(ISimpleContent)\n ... form_fields['relation'].custom_widget = widget_factory\n\n\nIt's easy ?\n\nReal test\n=========\n\nWe added this code in the ``example.py`` file, and the form would be\nbind to Document. We load it now::\n\n >>> from Products.Five.zcml import load_string\n >>> load_string(\"\"\"\n ... \n ... \"\"\")\n\nAnd now get an authenticated browser::\n\n >>> browser = self.getAuthenticatedBrowser()\n\nThe front-page is a document, so we should get our form::\n\n >>> browser.open('http://nohost/plone/front-page/relation.html')\n >>> 'Plone relation edit form' in browser.contents\n True\n \nSo we can search for Plone in this add widget, and should get one\nresponse, since by default there is only one document with the word\n*Plone*, the front page itself::\n \n >>> browser.getControl(name='form.relation.search_value').value='Plone'\n >>> browser.getControl(name='form.relation.search_button').click()\n\nAnd we got some results::\n\n >>> add_value = browser.getControl(name='form.relation.add_value:list')\n >>> add_value.getControl('Welcome to Plone').selected = True\n >>> browser.getControl(name='form.relation.add_button').click()\n >>> browser.getControl('Apply').click()\n >>> 'Updated on' in browser.contents\n True\n\nYou can look up the ``README.EXT.txt`` and ``example.py`` file for\nmore tests and examples.\n\n\nChanges\n=======\n\n1.0\n~~~~~\n\n- Add more tests,\n\n- Remove translation marker: they triggers errors under Plone 3. Now\n this work with Plone 3 as well.\n\n0.9\n~~~\n\n- First release, we need more functional or unit test to release 1.0.\n\n\nCredits\n=======\n\nThe first version of this widget have been released with the help of\nthe Flemish government of Belgium, for the application\n.\n\nYou can help us as well to contribute to this product, by sending your\nremarks or patchs at the author email address (or ask for an SVN\naccess).",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://svn.infrae.com/PloneComponent/infrae.plone.relations.form/trunk",
"keywords": "relationships plone widget formlib",
"license": "GPL",
"maintainer": null,
"maintainer_email": null,
"name": "infrae.plone.relations.form",
"package_url": "https://pypi.org/project/infrae.plone.relations.form/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/infrae.plone.relations.form/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://svn.infrae.com/PloneComponent/infrae.plone.relations.form/trunk"
},
"release_url": "https://pypi.org/project/infrae.plone.relations.form/1.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Formlib widget to manage plone.app.relations relations in a plone site.",
"version": "1.0"
},
"last_serial": 945364,
"releases": {
"0.9": [
{
"comment_text": "",
"digests": {
"md5": "1c8f9ffe75516c250913f3e753fd08b8",
"sha256": "80f6883d2561b901f6a24859137557bbd44ed0c0988636a0d7fad3b72a67c166"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-0.9-py2.4.egg",
"has_sig": false,
"md5_digest": "1c8f9ffe75516c250913f3e753fd08b8",
"packagetype": "bdist_egg",
"python_version": "2.4",
"requires_python": null,
"size": 45374,
"upload_time": "2008-06-12T13:03:31",
"url": "https://files.pythonhosted.org/packages/9b/35/581e3d836dae708e20d58612690ed0f93790e11b919e18663f4ef163a3a0/infrae.plone.relations.form-0.9-py2.4.egg"
},
{
"comment_text": "",
"digests": {
"md5": "c467a5b3f96a636190f3ce258049da97",
"sha256": "986be2821c1ba21cc9f19516bd38cada03828aca4e86f925976ee39be3499e59"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-0.9.tar.gz",
"has_sig": false,
"md5_digest": "c467a5b3f96a636190f3ce258049da97",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14663,
"upload_time": "2008-06-12T13:03:36",
"url": "https://files.pythonhosted.org/packages/f5/74/74569f5378bb82c76d3d0277fd34a1ea4a9ed764968b01865d0cd761b7a8/infrae.plone.relations.form-0.9.tar.gz"
}
],
"1.0": [
{
"comment_text": "",
"digests": {
"md5": "d90cdae59b250964dda5f3dca65accb7",
"sha256": "3f91db4851f464d4666ed09bc3409e1dfaf49657f659c381a01dec03ba4fdc0d"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-1.0-py2.4.egg",
"has_sig": false,
"md5_digest": "d90cdae59b250964dda5f3dca65accb7",
"packagetype": "bdist_egg",
"python_version": "2.4",
"requires_python": null,
"size": 49637,
"upload_time": "2008-06-13T13:09:36",
"url": "https://files.pythonhosted.org/packages/80/f1/4cc850060e8515585599bb027bafc05df268b1684b5355440c8c7dcc6302/infrae.plone.relations.form-1.0-py2.4.egg"
},
{
"comment_text": "",
"digests": {
"md5": "7105b892e568a938bc52b785fc97730d",
"sha256": "3172453801f7ba8ded86befd5f517456f3d38aa93817e4aed75dc61f4a1ebbfc"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-1.0.tar.gz",
"has_sig": false,
"md5_digest": "7105b892e568a938bc52b785fc97730d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17419,
"upload_time": "2008-06-13T13:09:42",
"url": "https://files.pythonhosted.org/packages/e4/03/7a38fd4b6b6dd48f6c1283cbfdd4c8dd67fe65b025b250ae5140d73b1dce/infrae.plone.relations.form-1.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "d90cdae59b250964dda5f3dca65accb7",
"sha256": "3f91db4851f464d4666ed09bc3409e1dfaf49657f659c381a01dec03ba4fdc0d"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-1.0-py2.4.egg",
"has_sig": false,
"md5_digest": "d90cdae59b250964dda5f3dca65accb7",
"packagetype": "bdist_egg",
"python_version": "2.4",
"requires_python": null,
"size": 49637,
"upload_time": "2008-06-13T13:09:36",
"url": "https://files.pythonhosted.org/packages/80/f1/4cc850060e8515585599bb027bafc05df268b1684b5355440c8c7dcc6302/infrae.plone.relations.form-1.0-py2.4.egg"
},
{
"comment_text": "",
"digests": {
"md5": "7105b892e568a938bc52b785fc97730d",
"sha256": "3172453801f7ba8ded86befd5f517456f3d38aa93817e4aed75dc61f4a1ebbfc"
},
"downloads": -1,
"filename": "infrae.plone.relations.form-1.0.tar.gz",
"has_sig": false,
"md5_digest": "7105b892e568a938bc52b785fc97730d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17419,
"upload_time": "2008-06-13T13:09:42",
"url": "https://files.pythonhosted.org/packages/e4/03/7a38fd4b6b6dd48f6c1283cbfdd4c8dd67fe65b025b250ae5140d73b1dce/infrae.plone.relations.form-1.0.tar.gz"
}
]
}