{ "info": { "author": "Jason Mehring", "author_email": "nrgaway@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Plone", "Framework :: Plone :: 4.2", "Framework :: Plone :: 4.3", "Framework :: Plone :: 5.0", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Widget Sets" ], "description": ".. image:: https://travis-ci.org/collective/plone.formwidget.masterselect.svg\n :target: https://travis-ci.org/collective/plone.formwidget.masterselect\n\n.. image:: https://coveralls.io/repos/collective/plone.formwidget.masterselect/badge.png\n :target: https://coveralls.io/r/collective/plone.formwidget.masterselect\n\nMasterSelectWidget\n==================\n\nThis is a z3cform widget based on the orginal Archetypes widget which\ncontrols the vocabulary or display of other fields on an edit page. It\nneeds to be given information about which fields to control and how to control\nthem.\n\nFeel free to help edit this document to help explain things better!\n\n\nExample\n=======\n\nFor more complex examples see ``demo.py`` in pacakge directory.::\n\n from zope import schema\n from plone.supermodel import model\n from plone.formwidget.masterselect import _\n from plone.formwidget.masterselect import MasterSelectBoolField\n from plone.formwidget.masterselect import MasterSelectField\n\n\n class IMasterSelectDemo(model.Schema):\n \"\"\" MasterSelect Demo to demonstrate all options available to\n use and to allow the test modules a content type to work\n with.\n \"\"\"\n\n masterField = MasterSelectField(\n title=_(u\"MasterField\"),\n description=_(u\"This field controls the vocabulary of slaveField1,\"\n \"the available values in slaveField1 will be equal \"\n \"to the numbers between the selected number and 10. \"\n values=(1, 2, 3, 4, 5, 6),\n slave_fields=(\n # Controls the vocab of slaveField1\n {'name': 'slaveField1',\n 'action': 'vocabulary',\n 'vocab_method': getSlaveVocab,\n 'control_param': 'master',\n },\n # Controls the visibility of slaveField1 also\n {'name': 'slaveField1',\n 'action': 'hide',\n 'hide_values': ('6',),\n 'siblings': True,\n },\n ),\n required=True,\n )\n\n slaveField1 = schema.Set(\n title=_(u\"SlaveField1\"),\n description=_(u\"This field's vocabulary is controlled by the value \"\n \"selected in masterField. The values available here \"\n \"will be the numbers between the number selected in \"\n \"masterField and 10. The field will be hidden when 6 \"\n \"is selected in the masterField.\"),\n value_type=schema.Choice(values=(1, 2, 3, 4, 5, 6)),\n required=False,\n )\n\n\nParameters\n==========\n\nAll the magic happens in the slave_fields parameter which should be a\nsequence of mappings. Each mapping is a description of a field controlled\nby this master field:\n\n\nname\n----\n\nThe name of the field to control on when the selection changes. The\ncontrolled field/widget may be of any type unless the 'vocabulary' or\n'value' action is used. When the action is 'vocabulary', the field must\nuse either a MultiSelectionWidget, a SelectionWidget, or a\nMasterSelectWidget any of which must have the 'format' parameter set\nto 'select' (this is the default only for MasterSelectWidget). For\n'value', the widget must be simple enough to change the current value\nusing element.value or elem.selectedIndex (StringWidget, SelectionWidget,\nAutoCompleteWidget, maybe others).\n\n\nmasterID\n--------\n\nThis is optional and will automatically be calculated if omited. It can\nbe used to specify the exact master field is that is rendered in the html\ndocument. Normally you will only need to set this for checkbox masters\nsince their id has a -0 added like this: #form-widgets-checkboxfield-0.\nNote that this is a jQuery ID selector.\n\nmasterSelector\n--------------\n\nThis is optional and will default to master ID if not defined.\nIt has the same usage as masterID but allows to specify any JQuery selector (not\njust an ID).\n\nslaveID\n-------\n\nThis is optional and will automatically be calculated if omited. It can\nbe used to specify the exact slave field name to control in the html form.\nNote that this is a jQuery ID selector, so something use something\nlike this: #form-widgets-field\n\n\naction\n------\n\nThe type of action to perform on the slave field. This can be:\n\n``vocabulary``\n which alters the vocabulary of the slave field using an\n XMLHttpRequest call. To use the ``vocabulary`` action, the slave\n field must meet the widget requirements stated above.\n\n``enable`` or ``disable``\n toggle which marks the target widget as enabled or disabled; To use the\n ``enable / disable`` actions, the field must use a HTML widget that can be\n enabled/disabled.\n\n``show`` or ``hide``\n toggle which marks the target widget as show or hide.\n\n``value``\n which alters the value of another simple widget (StringWidget) on\n selection change using an XMLHttpRequest call.\n\n``attr``\n which alters the value of a DOM element, specified by slaveID\n\n``jquery``\n **NOT YET IMPLEMENTED**\n a complete jquery statement that will be sent back to the DOM to be\n executed.\n\n\nvocab_method\n------------\n\nThe name of a method to call to retrieve the dynamic vocabulary for\nthe slave field, or the value for the slave field when 'value' is used.\nFor 'vocabulary', this must return a DisplayList. For 'value, it must\nreturn a string or msg_id. The method must accept a parameter which\nwill be used to pass the new value selected in the master widget. The\nname of this parameter defaults to 'master_value', but any name may be\nused as long as it is specified using the control_param element. Used\nonly with 'action':'vocabulary' or 'action':'value'.\n\ncontrol_param\n-------------\n\nAs described above, this is the name of the paramter used when\ncalling the vocab_method. Used only with 'action':'vocabulary',\n'action':'value', 'action':'attr' and 'action':'jquery'.\n\nhide_values\n-----------\n\nA sequence of values which when selected in the master widget cause\nthe slave field/widget to be hidden, shown or disabled. The method\nused is determined by the 'action' element. Used only with\n'action':'hide', 'action':'enable', 'action':'disable' or\n'action':'show'. The value '()' (dont use quotes) will trigger on\nanything.\n\nsiblings\n--------\n\nBoolean value to indictate the siblings of the slave field should be\nselected as well as the slave field itself. This field can only be used\nwith 'action':'hide' or 'action':'show' and is useful for hidng the label\nas well the slave field.\n\nempty_length\n------------\n\nThe position in the slave slave field to start deleting entries from the\nselection box when the selection box gets refreshed with new data. The\nselection box options are deleted before the Ajax call so it can not be\nused until the call is complete. This can be useful to prevent a small\nselect box from appearing is the first option is '-------------'. This\nfield is optional and can only be used with 'action':'vocabulary'.\nThis value is also crecked before initating an ajax request. The ajax\nrequest will not be executed if the master select length is equal to or less\nthan this number to help prevent slave widgets executing out of order.\nDefault value is 0.\n\nprevent_ajax_values\n-------------------\n\nA sequence of values which when selected in the master widget prevent the\nwidget from iniating an ajax request. Use ('') as the value to prevent an\najax call if the select option value is ''. The default is ().\n\ninitial_trigger\n---------------\n\nBoolean indicated if the master widget should initally be triggered on\nload. Default is true for everything except vocabulary in which case it is\nfalse to prevent an initial ajax call which usually will not be needed.\n\nA single MasterSelectWidget may control any number of slave fields, new\nfields are controlled by adding new mappings to the slave_fields list/tuple.\nA field which is the target of a MasterSelectWidget action may itself use\na MasterSelectWidget to control other fields.\n\nThe MasterSelectDemo type includes a number of master and slave widgets in\ndifferent configurations. It is disabled by default, but you may import it\nthrough portal_setup tool and test it by checking the \"implicitly addable\"\ncheckbox for it in the MasterSelectDemo entry in the portal_types tool.\n\nEnjoy!\n\n\nSpecial case with ContactChoice\n===============================\n\nSince collective.contact.widget 1.8, you can use the ContactChoice field as\na master field, but it requires a special configuration for masterID and\nmasterType properties. Here is an example::\n\n organization = ContactChoice(\n title=_(u\"Organization\"),\n required=True,\n source=ContactSourceBinder(obj_types=('organization',)),\n slave_fields=(\n {'name': 'department',\n 'masterID': 'form-widgets-organization-input-fields',\n 'masterType': 'ContactChoice',\n 'slaveID': '#form-widgets-department',\n 'action': 'vocabulary',\n 'vocab_method': get_organization_directions_vocabulary,\n 'control_param': 'selected_organism',\n 'initial_trigger': True\n },\n )\n )\n\n\n\nAuthor\n------\n\n- Jason Mehring: nrgaway@gmail.com\n\nOrginal Author of Archetypes Widget\n-----------------------------------\n\n- Alec Mitchell: apm13@columbia.edu\n\nContributors\n------------\n\n- Dorneles Tremea: deo@plonesolutions.com\n- C\u00e9dric Messiant, Ecreall: cedricmessiant@ecreall.com\n- Vincent Fretin, Ecreall: vincentfretin@ecreall.com\n- Daniel Widerin, daniel@widerin.net\n\n\nChangelog\n=========\n\n1.6 (2016-10-11)\n----------------\n\n- Add optional support for ContactChoice from collective.contact.widget >= 1.8\n as master field.\n [vincentfretin]\n\n- Trigger liszt:updated event in updateSelect to force update\n of select chosen slave field from collective.z3cform.chosen.\n [vincentfretin]\n\n- Fixed visual issue: in an overlay, i\n toggle was done one time for each checkbox or radio option.\n [thomasdesvenain]\n\n- Fix package metadata and trove classifiers.\n [hvelarde]\n\n\n1.5.2 (2016-08-08)\n------------------\n\n- Use zope2.View instead of cmf.AddPortalContent for masterselect-jsonvalue\n view. In an edit form, the user doesn't necessary have the Add portal content\n permission.\n [vincentfretin]\n\n\n1.5.1 (2016-01-08)\n------------------\n\n- Fix side-effect when updating field.vocabulary. Do now a copy of the field\n before changing the vocabulary.\n [vincentfretin]\n\n\n1.5 (2015-11-24)\n----------------\n\n- Translate the \"vocabulary\" slave field terms (like \"No value\") when entire vocabulary is replaced.\n [sgeulette]\n\n\n1.4.1 (2014-10-30)\n------------------\n\n- jQuery 1.9 compatible.\n [vincentfretin]\n\n\n1.4 (2014-10-09)\n----------------\n\n- masterselect.js is now cacheable.\n [vincentfretin]\n\n- Move to plone.app.testing. Migrate selenium tests from windmill to\n robotframework.\n [saily]\n\n- Add travis and coveralls integration.\n [saily]\n\n- Documentation updates. Fix rst error in ``CHANGES.rst``. Add an example\n to ``README.rst``.\n [saily]\n\n- Add egg-contained buildout.\n [saily]\n\n\n1.3 (2014-06-16)\n----------------\n\n- Do not use fast transition on initial trigger.\n [thomasdesvenain]\n\n- Master select features work when form is loaded in an overlay.\n [thomasdesvenain]\n\n- Fix bug when masterselect is in a fieldset that is not visible.\n [cedricmessiant]\n\n- Add master select radio widget and ability to specify a master Selector\n instead of masterID [ebrehault]\n\n\n1.2 (2013-11-04)\n----------------\n\n- Added a ('fast') jQuery transition on show/hide function.\n [thomasdesvenain]\n\n\n1.1 (2013-08-26)\n----------------\n\n- Made compatible with z3c.form 3.0 and jQuery 1.6+.\n Note: this version drops compatibility with jQuery 1.4.\n Please use plone.formwidget.masterselect 1.0 for plone\n versions < 4.3\n\n\n1.0 (2013-06-10)\n----------------\n\n- Replaced jq by jQuery in generated scripts.\n [vincentfretin]\n\n- Removed plone.directives.form dependency\n Removed plone.app.jquerytools dependency\n Fixed demo profile\n Made some cleanup\n [cedricmessiant]\n\n- Initial checkin, ready for testing.\n [JMehring]", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/plone.formwidget.masterselect", "keywords": "plone widget", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "plone.formwidget.masterselect", "package_url": "https://pypi.org/project/plone.formwidget.masterselect/", "platform": "", "project_url": "https://pypi.org/project/plone.formwidget.masterselect/", "project_urls": { "Homepage": "https://github.com/collective/plone.formwidget.masterselect" }, "release_url": "https://pypi.org/project/plone.formwidget.masterselect/1.6/", "requires_dist": null, "requires_python": "", "summary": "A z3c.form widget that controls the vocabulary or display of other fields on an edit page", "version": "1.6" }, "last_serial": 2393331, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f9ed1d755670c1c5492d55856a61386b", "sha256": "3171662c1305d1b68b2f20c034fe3dfe90410bf35df1522775bcbae275a6603d" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.0.zip", "has_sig": false, "md5_digest": "f9ed1d755670c1c5492d55856a61386b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40016, "upload_time": "2013-06-10T18:19:21", "url": "https://files.pythonhosted.org/packages/71/c9/ba8646a56c317977c2bc52ab1dc7c15be9170b2edfa2650de7c841305035/plone.formwidget.masterselect-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "58fb403347486efa83d23a4656ab8bb0", "sha256": "e33d7285170a95290cddb1e912a3336f7ae2837b61d374c5c267a46084309f49" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.1.zip", "has_sig": false, "md5_digest": "58fb403347486efa83d23a4656ab8bb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40366, "upload_time": "2013-08-26T15:29:13", "url": "https://files.pythonhosted.org/packages/71/b9/b96d3d473d531aab60699b8e97a5aed84cc4886b86cadb0c4264749c6a52/plone.formwidget.masterselect-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "35e76d6d162b1223b23ea40b52243c9f", "sha256": "feaa4550bc482e2a2f1db2c627c4a90544fc69532f18eb35b5446b7b92eb920d" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.2.zip", "has_sig": false, "md5_digest": "35e76d6d162b1223b23ea40b52243c9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40554, "upload_time": "2013-11-04T11:04:59", "url": "https://files.pythonhosted.org/packages/c4/07/e11ecb0d2e8294b8a25ee65b862f2a675548e61ab9698aa509bc3bf5a232/plone.formwidget.masterselect-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "571f646af4b473370ef7698d8fa6aacf", "sha256": "a99d4fc322d95b4219d377ea0c22837b1ae1af8104d9b13b26a5c808a1970e3b" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.3.zip", "has_sig": false, "md5_digest": "571f646af4b473370ef7698d8fa6aacf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42475, "upload_time": "2014-06-16T12:10:53", "url": "https://files.pythonhosted.org/packages/17/63/8831b56d1d4da860950cc14ebeb25859a93968dc78a7db8fca00f6325a56/plone.formwidget.masterselect-1.3.zip" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "4dbc3a6dd80b19728794370d6e6df908", "sha256": "714b54ab9f24a5f8cfe92f690f25ebb7e4d2c9c87ae3bf9a6c84b789b670aabc" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.4.zip", "has_sig": false, "md5_digest": "4dbc3a6dd80b19728794370d6e6df908", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51498, "upload_time": "2014-10-09T15:40:27", "url": "https://files.pythonhosted.org/packages/fe/be/af4dad5bf4757171632de312831be64ad0123e8ce19dd7026474ecc2fa0c/plone.formwidget.masterselect-1.4.zip" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "0e04abcef90100b3518fd3eef91ade74", "sha256": "d763fb63a58b796e59e10301b1d4125ed78a1b5c34cc958ffaf7aeda0022fef4" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.4.1.zip", "has_sig": false, "md5_digest": "0e04abcef90100b3518fd3eef91ade74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50269, "upload_time": "2014-10-30T12:48:38", "url": "https://files.pythonhosted.org/packages/47/a4/d53ccd73645603db282db3a277842d3cd804715cd7f9575befbfdbb0cfe4/plone.formwidget.masterselect-1.4.1.zip" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "c5554a89393458b524288cd1deb3114b", "sha256": "cf8c662e9a5f76dff19b6610996db329c65920f32f3aeb5724a4cd9f8ad1f5a0" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.5.zip", "has_sig": false, "md5_digest": "c5554a89393458b524288cd1deb3114b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50610, "upload_time": "2015-11-24T13:15:20", "url": "https://files.pythonhosted.org/packages/44/e5/42a400c33811290c50c957c2f4d64c998535d9876db327eaafe4ebc57587/plone.formwidget.masterselect-1.5.zip" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "ddd444d8c692e3a5478ed47a89b50e23", "sha256": "1ea5812b01b8d28367e83c3d60e7a162940d3de94f8ba3ffdcdbd5dc90a131e3" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.5.1.tar.gz", "has_sig": false, "md5_digest": "ddd444d8c692e3a5478ed47a89b50e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30257, "upload_time": "2016-01-08T13:20:21", "url": "https://files.pythonhosted.org/packages/be/55/54ba9b01a483ead442452d030eefd40261022ab263059e17abd9fea3efa2/plone.formwidget.masterselect-1.5.1.tar.gz" } ], "1.5.2": [ { "comment_text": "", "digests": { "md5": "797ca594f36d6a01d0020c239e76bddd", "sha256": "6c72bf24b5e6f763db1a914da01975c539a95eae2ab3f49b777835db77328411" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.5.2.tar.gz", "has_sig": false, "md5_digest": "797ca594f36d6a01d0020c239e76bddd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33242, "upload_time": "2016-08-08T09:14:08", "url": "https://files.pythonhosted.org/packages/97/3e/80efacdf77c124dc99ae6fee9dacdfac32b5d2fffaf4a80447f4fdbdbd6e/plone.formwidget.masterselect-1.5.2.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "396bd598e15de2b4605a91fa3bae6962", "sha256": "2bbedf9fe86da82fdf648dd6823455a8736706f050f27360f59084c4a983c2dd" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.6.tar.gz", "has_sig": false, "md5_digest": "396bd598e15de2b4605a91fa3bae6962", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32829, "upload_time": "2016-10-11T13:51:21", "url": "https://files.pythonhosted.org/packages/00/4b/5feaadf2c45078a0f5d03c46a70e937e37ab65eb2f35f94319f197c7568b/plone.formwidget.masterselect-1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "396bd598e15de2b4605a91fa3bae6962", "sha256": "2bbedf9fe86da82fdf648dd6823455a8736706f050f27360f59084c4a983c2dd" }, "downloads": -1, "filename": "plone.formwidget.masterselect-1.6.tar.gz", "has_sig": false, "md5_digest": "396bd598e15de2b4605a91fa3bae6962", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32829, "upload_time": "2016-10-11T13:51:21", "url": "https://files.pythonhosted.org/packages/00/4b/5feaadf2c45078a0f5d03c46a70e937e37ab65eb2f35f94319f197c7568b/plone.formwidget.masterselect-1.6.tar.gz" } ] }